AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Rw Integrate Character Embed

skill-runwayml-skills-rw-integrate-character-embed · by runwayml

Help users embed Runway Character avatar calls in React apps using the @runwayml/avatars-react SDK

No reviews yet
0 installs
4 views
0.0% view→install

Install

$ agentstack add skill-runwayml-skills-rw-integrate-character-embed

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets Used
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-runwayml-skills-rw-integrate-character-embed)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Rw Integrate Character Embed? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Embed Characters in React (Avatars React SDK)

> 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.

Installation

npm install @runwayml/avatars-react

This is a client-side package. The server-side @runwayml/sdk should already be installed from +rw-integrate-characters.

Option A: Simple — AvatarCall Component

The fastest way to embed a character. Handles WebRTC connection and renders a default UI automatically.

'use client';

import { AvatarCall } from '@runwayml/avatars-react';
import '@runwayml/avatars-react/styles.css';

export default function CharacterPage() {
  return (
     console.log('Call ended')}
      onError={(error) => console.error('Error:', error)}
    />
  );
}

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.

Option B: Fully Custom — Hooks

For full control over the UI, use AvatarSession with hooks.

Components & 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() |

Custom UI Example

'use client';

import {
  AvatarSession,
  AvatarVideo,
  UserVideo,
  useAvatarSession,
  useLocalMedia,
} from '@runwayml/avatars-react';
import type { SessionCredentials } from '@runwayml/avatars-react';

function CallUI() {
  const { state, end } = useAvatarSession();
  const { isMicEnabled, toggleMic } = useLocalMedia();

  return (
    
      {/* Avatar video takes full screen */}
      

      {/* User's camera in a small overlay */}
      

      {/* Controls */}
      
        
          {isMicEnabled ? 'Mute' : 'Unmute'}
        
        End Call
      

      {/* Connection state */}
      {state === 'connecting' && (
        
          Connecting...
        
      )}
    
  );
}

export function CustomAvatar({ credentials }: { credentials: SessionCredentials }) {
  return (
    
      
    
  );
}

Fetching Credentials for Custom UI

When using the hooks approach, you need to fetch credentials from your server endpoint and pass them to AvatarSession:

'use client';

import { useState, useCallback } from 'react';
import type { SessionCredentials } from '@runwayml/avatars-react';
import { CustomAvatar } from './CustomAvatar';

export default function CharacterPage() {
  const [credentials, setCredentials] = useState(null);
  const [loading, setLoading] = useState(false);

  const startCall = useCallback(async () => {
    setLoading(true);
    try {
      const res = await fetch('/api/avatar/session', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ avatarId: 'your-avatar-id-here' }),
      });
      const data = await res.json();
      setCredentials(data);
    } catch (error) {
      console.error('Failed to connect:', error);
    } finally {
      setLoading(false);
    }
  }, []);

  if (credentials) {
    return ;
  }

  return (
    
      {loading ? 'Connecting...' : 'Start Conversation'}
    
  );
}

Integration Patterns

Next.js App Router (Full Example)

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):

'use client';

import { AvatarCall } from '@runwayml/avatars-react';
import '@runwayml/avatars-react/styles.css';

const AVATAR_ID = process.env.NEXT_PUBLIC_AVATAR_ID || 'your-avatar-id';

export default function CharacterPage() {
  return (
    
       window.location.reload()}
        onError={(error) => {
          console.error('Avatar error:', error);
          alert('Connection failed. Please try again.');
        }}
      />
    
  );
}

Conditional Rendering (Show/Hide)

'use client';

import { useState } from 'react';
import { AvatarCall } from '@runwayml/avatars-react';
import '@runwayml/avatars-react/styles.css';

export default function SupportPage() {
  const [showAvatar, setShowAvatar] = useState(false);

  return (
    
      Customer Support

      {!showAvatar ? (
         setShowAvatar(true)}>
          Talk to an Agent
        
      ) : (
         setShowAvatar(false)}
          onError={(error) => {
            console.error(error);
            setShowAvatar(false);
          }}
        />
      )}
    
  );
}

Error Handling

Verbose Error Logging

 {
    console.error('Avatar error:', error);
    console.error('Error name:', error.name);
    console.error('Error message:', error.message);
    if (error.cause) {
      console.error('Cause:', error.cause);
    }
  }}
/>

Debug Session State

import { useAvatarSession } from '@runwayml/avatars-react';

function DebugPanel() {
  const { state, sessionId, error } = useAvatarSession();

  return (
    
      {JSON.stringify({ state, sessionId, error: error?.message }, null, 2)}
    
  );
}

Browser Support

| 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.

Tips

  • Always import the styles: 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 SDK
  • Session max duration is 5 minutes — handle the onEnd callback to show a reconnect option
  • Credentials are one-time use — if connection fails, fetch new credentials (create a new session)
  • For the full SDK source, examples, and issue tracking: github.com/runwayml/avatars-sdk-react

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.