ElevenLabs embed · Next.js
This is the hello-world integration. Fork it, run locally, and drop the same embed into your product shell.
From the repo root, ./start runs all examples (or ./start sveltekit / ./start nextjs / ./start react-vite for those frameworks). To run only this one:
cd examples/elevenlabs-embed/nextjs
npm install
npm run dev
# http://localhost:4006 Local URL: http://localhost:4006
The demo uses a single public experience id
(exp_01EXAMPLES_COFFEE_BARISTA) written directly in the page.
Use a client component and import Experience from @liforma/client/react (not /next):
'use client';
import { Experience } from '@liforma/client/react';
export function Demo() {
return <Experience experienceId="exp_01EXAMPLES_COFFEE_BARISTA" />;
} lib/helloByo.ts — copy into your product — startByoSpeech (thin SDK call)app/DemoApp.tsx — demo scaffolding only (Connect / Start UI)app/api/…/route.ts — demo credential mintUse the Liforma ElevenLabs embed Next.js App Router example as source material.
Source repo folder: examples/elevenlabs-embed/nextjs
Copy `helloByo.ts` (`startByoSpeech` → `connectElevenLabsAgent`) into your product — that is the integration.
`DemoApp.tsx` is demo scaffolding only.
Preserve:
- `<Experience />` from `@liforma/client/react` in presenter mode with `speechInputMode="off"`
- `'use client'` on the Experience mount component
- import from `@liforma/client/react` (not `/next` — that export is the session-route helper)
- `startByoSpeech(experience, { signedUrl })` after audio unlock (thin wrapper over `connectElevenLabsAgent`)
- signed-URL mint on a server route / Vite middleware (never ship ElevenLabs API keys to production browsers)
- TypeScript and normal CSS (no Tailwind)
Adapt:
- branding
- experience id
- your ElevenLabs agent
- production signed-URL backend