npx skills add ...
npx skills add runwayml/skills --skill rw-integrate-character-embed
Help users embed Runway Character avatar calls in React apps using the @runwayml/avatars-react SDK
npx skills add runwayml/skills --skill rw-integrate-character-embed
PREREQUISITES:
+rw-check-compatibility— Project must have server-side capability (API key must never be exposed to the client)+rw-fetch-api-reference— Load the latest API reference from https://docs.dev.runwayml.com/api/ before integrating+rw-integrate-characters— Character (Avatar) must be created and session endpoint must exist- Project must use React (Next.js, Vite+React, Remix, etc.)
OPTIONAL:
+rw-integrate-documents— Add knowledge base before embedding
Embed real-time avatar video calls in React applications using the @runwayml/avatars-react SDK.
This is a client-side package. The server-side @runwayml/sdk should already be installed from +rw-integrate-characters.
AvatarCall ComponentThe fastest way to embed a character. Handles WebRTC connection and renders a default UI automatically.
AvatarCall Props| Prop | Type | Description |
|---|---|---|
avatarId | string | The Avatar UUID from the Developer Portal or API |
connectUrl | string | Your server-side session endpoint (e.g., /api/avatar/session) |
onEnd | () => void | Called when the call ends normally |
onError | (error: Error) => void | Called on connection or runtime errors |
For custom avatars created in the Developer Portal, use the Avatar UUID as avatarId.
For full control over the UI, use AvatarSession with hooks.
| Export | Type | Description |
|---|---|---|
AvatarSession | Component | Provider that manages the WebRTC session |
AvatarVideo | Component | Renders the avatar's video stream |
UserVideo | Component | Renders the user's camera feed |
useAvatarSession | Hook | Access session state: state, sessionId, error, end() |
useLocalMedia | Hook | Control user's media: isMicEnabled, toggleMic() |
When using the hooks approach, you need to fetch credentials from your server endpoint and pass them to AvatarSession:
Server route (app/api/avatar/session/route.ts):
See +rw-integrate-characters for the complete server-side session creation code.
Client page (app/character/page.tsx):
| Browser | Minimum Version |
|---|---|
| Chrome | 74+ |
| Firefox | 78+ |
| Safari | 14.1+ |
| Edge | 79+ |
Users must grant microphone permissions when prompted. Camera permissions are needed if user video is enabled.
import '@runwayml/avatars-react/styles.css' when using AvatarCall'use client' directive is required in Next.js App Router for all components using the React SDKonEnd callback to show a reconnect option