[elevenlabs] Add createElevenLabsSession helper and example#36
Open
robinandeer wants to merge 3 commits into
Open
[elevenlabs] Add createElevenLabsSession helper and example#36robinandeer wants to merge 3 commits into
robinandeer wants to merge 3 commits into
Conversation
Server-side helper that connects a customer-owned ElevenLabs ConvAI agent to a Runway avatar in one call: fetches a signed WebSocket URL from ElevenLabs, creates a Runway realtime session with the elevenlabs integration, and polls until READY. Exported from @runwayml/avatars-react/api. - Reuses the existing pollUntilReady helper instead of a bespoke poll loop - Sends the correct model literal (gwm1_avatars) and integration payload - Adds a nextjs-elevenlabs example wiring the helper to a standard AvatarCall - Unit tests covering the signed-url -> create -> poll flow and error paths
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Extract fetchElevenLabsSignedUrl and createRunwayElevenLabsSession so the public helper reads as a three-step flow, and dedupe test fixtures.
leagerl1
approved these changes
Jul 1, 2026
| # Get yours at https://dev.runwayml.com/ (prod) or dev-stage for staging | ||
| RUNWAYML_API_SECRET= | ||
|
|
||
| # Optional Runway API base URL (defaults to production) |
There was a problem hiding this comment.
do we typically note our stage API in public examples? thats really just for internal use right so should we remove?
| 1. Copy `.env.example` to `.env.local` and fill in your keys: | ||
|
|
||
| - **`RUNWAYML_API_SECRET`** — API key from the same environment you target (see below) | ||
| - **`RUNWAY_API_BASE_URL`** — optional; defaults to production (`https://api.dev.runwayml.com`) |
| - **`ELEVENLABS_AGENT_ID`** — create an agent at [elevenlabs.io/app/agents](https://elevenlabs.io/app/agents/agents) | ||
| - **`RUNWAY_AVATAR_ID`** — custom avatar from the matching Developer Portal | ||
|
|
||
| **Stage testing** (after integration is deployed to stage): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
createElevenLabsSession(exported from@runwayml/avatars-react/api): server-side helper that fetches an ElevenLabs signed URL, creates a Runway realtime session withintegration: { type: "elevenlabs", signedUrl }, and polls until READY.@runwayml/avatars-react/api(core had it; react/apiwas missing the re-export).examples/nextjs-elevenlabs/— wires the helper to<AvatarCall>with stage-friendlyRUNWAY_API_BASE_URLand.env.localoverride innext.config.ts.Why
Companion to the API + streaming-inference ElevenLabs integration work. Customers with their own ElevenLabs ConvAI agent get a Runway avatar on top with one server-side call. No ElevenLabs SDK on the client.
Companion PRs (merge last, after API + SI deploy):
Supersedes #29.
Review guide
Start here:
packages/core/src/api/elevenlabs.ts, thenpackages/react/src/api/index.ts(re-export), thenexamples/nextjs-elevenlabs/app/api/avatar/connect/route.ts.Review question: Is
createElevenLabsSessionthe right SDK surface, or should customers call the public API directly and only useconsumeSessionclient-side?Not in this PR: dev-docs OpenAPI regen for
integration(follow-up after API merge).Test plan
bun test packages/incl.elevenlabs.test.tsbun run typecheck+ lint + buildexamples/nextjs-elevenlabsagainstapi.dev-stage.runwayml.com— smooth avatar + ElevenLabs agent audioTry it:
bun run buildat repo root, thencd examples/nextjs-elevenlabs && bun install && bun run dev. Agent must use PCM 16000 Hz.