Gemini Live embed · Vanilla HTML

Gemini Live embed — Vanilla HTML

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/gemini-live-embed/vanilla
npx serve . -l tcp://localhost:4010
# http://localhost:4010

Local URL: http://localhost:4010

Experience id

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

Liforma integration

Load the CDN script and mount the web component with one experience id:

embed
<script src="https://cdn.liforma.ai/sdk/v2/client.js"><\/script>

<liforma-experience experience-id="exp_01EXAMPLES_COFFEE_BARISTA"></liforma-experience>

Key files

  • helloByo.jscopy the npm pattern from docs — vanilla wraps bridge.js
  • app.js — demo scaffolding only
  • bridge.js — CDN port of the SDK helper
  • server.mjs — demo mint / proxy

Related docs

AI agent prompt

Use the Liforma Gemini Live embed example as source material to build a vanilla HTML app.

Source repo folder: examples/gemini-live-embed/vanilla

Copy `helloByo.js` (`startByoSpeech`) — thin wrapper over `bridge.js` / `connectGeminiLive`.
`app.js` is demo scaffolding only. Prefer `@liforma/client/google` in bundled apps.

Preserve:
- CDN script: https://cdn.liforma.ai/sdk/v2/client.js
- `Experience.startSession` in presenter mode with `speechInputMode: 'off'`
- Gemini Live → Liforma bridge (pipe PCM + transcript into createUtterance)
- same-origin WebSocket proxy (`server.mjs` + `shared/gemini-live-proxy.mjs`) — never ship Google API keys to production browsers

Adapt:
- branding
- experience id
- Gemini Live model / system instruction
- production WebSocket proxy backend