Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Comprehensive Cloudflare platform skill covering Workers, D1, R2, KV, AI, Durable Objects, and security.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/realtimekit/README.md
1# Cloudflare RealtimeKit23Expert guidance for building real-time video and audio applications using **Cloudflare RealtimeKit** - a comprehensive SDK suite for adding customizable live video and voice to web or mobile applications.45## Overview67RealtimeKit is Cloudflare's SDK suite built on Realtime SFU, abstracting WebRTC complexity with fast integration, pre-built UI components, global performance (300+ cities), and production features (recording, transcription, chat, polls).89**Use cases**: Team meetings, webinars, social video, audio calls, interactive plugins1011## Core Concepts1213- **App**: Workspace grouping meetings, participants, presets, recordings. Use separate Apps for staging/production14- **Meeting**: Re-usable virtual room. Each join creates new **Session**15- **Session**: Live meeting instance. Created on first join, ends after last leave16- **Participant**: User added via REST API. Returns `authToken` for client SDK. **Do not reuse tokens**17- **Preset**: Reusable permission/UI template (permissions, meeting type, theme). Applied at participant creation18- **Peer ID** (`id`): Unique per session, changes on rejoin19- **Participant ID** (`userId`): Persistent across sessions2021## Quick Start2223### 1. Create App & Meeting (Backend)2425```bash26# Create app27curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<account_id>/realtime/kit/apps' \28-H 'Authorization: Bearer <api_token>' \29-d '{"name": "My RealtimeKit App"}'3031# Create meeting32curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<account_id>/realtime/kit/<app_id>/meetings' \33-H 'Authorization: Bearer <api_token>' \34-d '{"title": "Team Standup"}'3536# Add participant37curl -X POST 'https://api.cloudflare.com/client/v4/accounts/<account_id>/realtime/kit/<app_id>/meetings/<meeting_id>/participants' \38-H 'Authorization: Bearer <api_token>' \39-d '{"name": "Alice", "preset_name": "host"}'40# Returns: { authToken }41```4243### 2. Client Integration4445**React**:46```tsx47import { RtkMeeting } from '@cloudflare/realtimekit-react-ui';4849function App() {50return <RtkMeeting authToken="<participant_auth_token>" onLeave={() => {}} />;51}52```5354**Core SDK**:55```typescript56import RealtimeKitClient from '@cloudflare/realtimekit';5758const meeting = new RealtimeKitClient({ authToken: '<token>', video: true, audio: true });59await meeting.join();60```6162## Reading Order6364| Task | Files |65|------|-------|66| Quick integration | README only |67| Custom UI | README → patterns → api |68| Backend setup | README → configuration |69| Debug issues | gotchas |70| Advanced features | patterns → api |7172## RealtimeKit vs Realtime SFU7374| Choose | When |75|--------|------|76| **RealtimeKit** | Need pre-built UI, fast integration, React/Angular/HTML |77| **Realtime SFU** | Building from scratch, custom WebRTC, full control |7879RealtimeKit is built on Realtime SFU but abstracts WebRTC complexity with UI components and SDKs.8081## Which Package?8283Need pre-built meeting UI?84- React → `@cloudflare/realtimekit-react-ui` (`<RtkMeeting>`)85- Angular → `@cloudflare/realtimekit-angular-ui`86- HTML/Vanilla → `@cloudflare/realtimekit-ui`8788Need custom UI?89- Core SDK → `@cloudflare/realtimekit` (RealtimeKitClient) - full control9091Need raw WebRTC control?92- See `realtime-sfu/` reference9394## In This Reference9596- [Configuration](./configuration.md) - Setup, installation, wrangler config97- [API](./api.md) - Meeting object, REST API, SDK methods98- [Patterns](./patterns.md) - Common workflows, code examples99- [Gotchas](./gotchas.md) - Common issues, troubleshooting100101## See Also102103- [Workers](../workers/) - Backend integration104- [D1](../d1/) - Meeting metadata storage105- [R2](../r2/) - Recording storage106- [KV](../kv/) - Session management107108## Reference Links109110- **Official Docs**: https://developers.cloudflare.com/realtime/realtimekit/111- **API Reference**: https://developers.cloudflare.com/api/resources/realtime_kit/112- **Examples**: https://github.com/cloudflare/realtimekit-web-examples113- **Dashboard**: https://dash.cloudflare.com/?to=/:account/realtime/kit114