ElevenLabs embed · React (Vite)

ElevenLabs embed — React (Vite)

Runnable in repo

This is the hello-world integration. Fork it, run locally, and drop the same embed into your product shell.

Run locally

From the repo root, ./start runs all examples (or ./start sveltekit / ./start nextjs / ./start react-vite for those frameworks). To run only this one:

terminal
cd examples/elevenlabs-embed/react-vite
npm install
npm run dev
# http://localhost:4006

Local URL: http://localhost:4006

Experience id

The demo uses a single public experience id (exp_01EXAMPLES_COFFEE_BARISTA) written directly in the page.

Liforma integration

Import Experience from @liforma/client/react and pass one experience id:

embed
import { Experience } from '@liforma/client/react';

export function Demo() {
  return <Experience experienceId="exp_01EXAMPLES_COFFEE_BARISTA" />;
}

Key files

  • src/lib/helloByo.tscopy into your productstartByoSpeech (thin SDK call)
  • src/DemoApp.tsx — demo scaffolding only (Connect / Start UI)
  • server/api-handlers.mjs — demo credential mint

Related docs

AI agent prompt

Use the Liforma ElevenLabs embed React (Vite) example as source material.

Source repo folder: examples/elevenlabs-embed/react-vite

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"`
- import from `@liforma/client/react`
- `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