Nuxt
Mount the pipedog WebRTC offer endpoint in a Nuxt (Nitro) server route.
A Nitro server route handles POST /api/offer. The .post.ts suffix limits it to POST.
toWebRequest turns the h3 event into a web Request for offer.
Install
bun add @pipedog/core @pipedog/asyncio @pipedog/transport-smallwebrtc @pipedog/transport-websocket @pipedog/serializer-protobuf @pipedog/openai @pipedog/audio-silero @pipedog/audio-smart-turn@pipedog/audio-smart-turn isn't imported anywhere: the default turn strategies load it. To run
the snippet from a checkout instead, see Installation.
Files
The endpoints come from the shared module on the overview.
~/server/utils/voice re-exports it:
export { offer, runSocketAgent, socket } from "../../../shared/voice.ts";
import { offer } from "~/server/utils/voice";
// Nitro's Node, Bun or Deno preset: the media runs over UDP, so a serverless
// preset won't carry it. `toWebRequest` is auto-imported from h3.
export default defineEventHandler((event) => offer(toWebRequest(event)));
Nuxt auto-imports defineEventHandler and toWebRequest, so the handler doesn't import them. The
snippet ships server/auto-imports.d.ts so it typechecks without a Nuxt project. A Nuxt app
generates those declarations itself.
Run it
OPENAI_API_KEY=sk-... bunx nuxt devThe browser then POSTs its SDP offer to /api/offer.
Deploy
Use a Nitro preset that runs a Node, Bun or Deno server, such as node-server (the default),
bun or deno-server. The serverless presets don't carry the UDP media.
WebSocket
This snippet mounts only the offer. Nitro has its own WebSocket handlers, which this snippet doesn't
use. To serve WebSocket sessions, run a Bun or Deno
server next to the Nuxt app, or serve socket with serveFetch() from
@pipedog/transport-websocket/serve, which upgrades on Node, Bun and Deno.
Authentication
The route has no auth. Wrap offer with a session check before it runs, as in
Authentication. A Nitro server middleware works too.
pipedog is an unofficial community TypeScript port of Pipecat. It is not affiliated with or endorsed by Daily or the Pipecat project.
Portions adapted from the Pipecat documentation, Copyright (c) 2024–2025 Daily, BSD-2-Clause (see apps/docs/LICENSE-pipecat-docs).