Skip to content

docs: added realtime kit documentation #24293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@
/src/content/release-notes/queues.yaml @elithrar @jonesphillip @cloudflare/pcx-technical-writing
/src/content/docs/r2/ @oxyjun @elithrar @jonesphillip @aninibread @harshil1712 @cloudflare/workers-docs @cloudflare/pcx-technical-writing
/src/content/release-notes/r2.yaml @oxyjun @elithrar @aninibread @cloudflare/workers-docs @cloudflare/pcx-technical-writing
/src/content/docs/realtime/ @cloudflare/pcx-technical-writing @cloudflare/calls
/src/assets/images/realtime/ @cloudflare/pcx-technical-writing @cloudflare/calls
/public/realtime/ @cloudflare/pcx-technical-writing @cloudflare/calls
/src/content/docs/realtime/ @cloudflare/pcx-technical-writing @cloudflare/calls @roerohan @ravindra-dyte
/src/assets/images/realtime/ @cloudflare/pcx-technical-writing @cloudflare/calls @roerohan @ravindra-dyte
/public/realtime/ @cloudflare/pcx-technical-writing @cloudflare/calls @roerohan @ravindra-dyte
Comment on lines +123 to +125
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/src/content/docs/realtime/ @cloudflare/pcx-technical-writing @cloudflare/calls @roerohan @ravindra-dyte
/src/assets/images/realtime/ @cloudflare/pcx-technical-writing @cloudflare/calls @roerohan @ravindra-dyte
/public/realtime/ @cloudflare/pcx-technical-writing @cloudflare/calls @roerohan @ravindra-dyte
/src/content/docs/realtime/ @cloudflare/pcx-technical-writing @cloudflare/realtime @roerohan @ravindra-dyte
/src/assets/images/realtime/ @cloudflare/pcx-technical-writing @cloudflare/realtime @roerohan @ravindra-dyte
/public/realtime/ @cloudflare/pcx-technical-writing @cloudflare/realtime @roerohan @ravindra-dyte

/src/content/docs/stream/ @tsmith512 @ToriLindsay @cloudflare/pcx-technical-writing @renandincer @third774
/src/content/release-notes/stream.yaml @tsmith512 @ToriLindsay @cloudflare/pcx-technical-writing
/src/content/docs/workers/ @cloudflare/workers-docs @GregBrimble @irvinebroque @mikenomitch @korinne @WalshyDev @cloudflare/deploy-config @cloudflare/pcx-technical-writing @kodster28 @cloudflare/wrangler @cloudflare/workers-runtime-1 @cloudflare/wrangler
Expand Down Expand Up @@ -230,4 +230,4 @@
/src/content/docs/web-analytics/ @angelampcosta @cloudflare/pcx-technical-writing

# AI Prompts for Cloudflare Workers development
/public/workers/prompts/ @jahands @Maximo-Guk @jbwcloudflare @cloudflare/pcx-technical-writing
/public/workers/prompts/ @jahands @Maximo-Guk @jbwcloudflare @cloudflare/pcx-technical-writing
13 changes: 13 additions & 0 deletions public/__redirects
Original file line number Diff line number Diff line change
Expand Up @@ -2333,3 +2333,16 @@

# Calls
/calls/* /realtime/:splat 301

# Realtime
/realtime/limits /realtime/sfu/limits 302
/realtime/sessions-tracks /realtime/sfu/sessions-tracks/ 302
/realtime/get-started /realtime/sfu/get-started/ 302
/realtime/calls-vs-sfus /realtime/sfu/calls-vs-sfus/ 302
/realtime/https-api /realtime/sfu/https-api/ 302
/realtime/datachannels /realtime/sfu/datachannels/ 302
/realtime/simulcast /realtime/sfu/simulcast/ 302
/realtime/demos /realtime/sfu/demos/ 302
/realtime/example-architecture /realtime/sfu/example-architecture/ 302
/realtime/pricing /realtime/sfu/pricing/ 302
/realtime/changelog /realtime/sfu/changelog/ 302
58 changes: 58 additions & 0 deletions src/content/docs/realtime/concepts.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
pcx_content_type: concept
title: Concepts
sidebar:
order: 3
---

This page explains the core concepts and terminology used in RealtimeKit.

### Meeting

A **Meeting** is the fundamental communication channel in RealtimeKit. You can think of it like an event on your calendar - it's a persistent, long-lived container or "room" that serves as a blueprint for its [sessions](/realtime/concepts#session). Every session created for this meeting inherits the same base configuration, such as the title of the meeting and whether to automatically record the session when it starts. You add participants to the meeting, which grants them access to join a session of that meeting.

### Session

A **Session** is a single, live instance of a meeting. To continue the analogy, if a meeting is the calendar event, the session is the actual video call you join. It begins when the first participant joins and ends shortly after the last participant leaves. Each session is unique and has its own lifecycle, including its own set of participants and associated data like chat messages and recordings.

For example, you might have a recurring "Weekly Standup" **meeting** with five participants added to it. The standup that takes place on Monday, August 11th at 11:30 AM is a specific **session**. All five participants can join this session using their unique `authToken`. For the following week's standup, you could create a new meeting and add participants again, or you could simply reuse the existing meeting and auth tokens (as long as they haven't expired) to create a new session.

### Preset

A **Preset** is a powerful template that defines a participant's role, permissions, and UI experience within a session. Beyond controlling permissions for actions like producing video and audio, sharing screens, and creating polls, presets also allow you to customize the look and feel of the UI, including colors and themes to match your app's branding.

Different participants in the same meeting can have different presets, allowing for complex and flexible roles. For example, in a large ed-tech class:

- The **teacher** might join with a `webinar-host` preset, giving them full control to share video, audio, and their screen.
- **Students** would join with a `webinar-participant` preset, which restricts them from sharing media but allows them to use the chat to ask questions.
- A **teaching assistant** could join with a `group-call-host` preset, enabling them to view all participants in a grid to monitor the class.

### Participant

A **Participant** is the server-side representation of a user within a session. When you add a user to a meeting via the REST API, a participant is created. This API call returns a unique `authToken` that the client-side SDK uses to join the session and authenticate the user.

### Peer

A **Peer** is the client-side representation of a [participant](/realtime/concepts#participant) in a session. While the terms are sometimes used interchangeably, a peer represents a specific instance of a participant joining the meeting. For example, if a single user joins the same meeting from two different browser tabs, they will have the same participant ID (also referred to as a user ID) but two unique peer IDs.

### Stage

The **Stage** is the logical space within a video call where participants can actively share their audio and video. In use cases like webinars, a participant's preset determines whether they have permission to be "on stage" as a presenter or if they are an audience member who only consumes the content.

### Waiting Room

The **Waiting Room** is a virtual lobby that provides an extra layer of security. When enabled, participants are held in the waiting room until a host with the proper permissions explicitly admits them into the main session. This is useful for controlling access to private or sensitive meetings.

### Core SDK

The **Core SDK** is the client-side library that provides the business logic for all of RealtimeKit's features. It is a data-only library that handles the complex media and networking tasks, giving you full control to build a completely custom user interface. It serves as the foundation upon which the UI Kit is built.

### UI Kit

The **UI Kit** is a library of pre-built, customizable UI components that sits on top of the Core SDK. It provides the fastest and simplest way to integrate a complete video and voice call interface into any application, allowing you to get started with just a few lines of code while still offering flexibility for customization.

### Realtime SFU (Selective Forwarding Unit)

A **Selective Forwarding Unit (SFU)** is a server architecture that efficiently manages real-time media streams in multi-party video calls. Instead of each participant sending their media directly to every other participant in a bandwidth-intensive mesh network, each participant sends a single stream to the SFU. The SFU then forwards those streams to the other participants, making it a highly scalable model.

The [**Realtime SFU**](/realtime/sfu) is Cloudflare's implementation of this architecture and is the core engine that powers RealtimeKit. It runs on Cloudflare's global Anycast network, meaning participants automatically connect to the nearest data center. This minimizes latency and ensures a high-quality experience regardless of a user's location. The SFU intelligently routes media, handling the complex task of receiving multiple streams and forwarding them to the appropriate participants.
7 changes: 7 additions & 0 deletions src/content/docs/realtime/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
pcx_content_type: navigation
title: Getting Started
sidebar:
order: 3
hidden: true
---
81 changes: 73 additions & 8 deletions src/content/docs/realtime/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,92 @@ head:
content: Overview
---

import { Description, LinkButton } from "~/components";
import {
Description,
LinkButton,
RelatedProduct,
CardGrid,
LinkTitleCard,
} from "~/components";

<Description>

Build real-time serverless video, audio and data applications.
Build Realtime apps with lowest latency - at any scale!

</Description>

Cloudflare Realtime is infrastructure for real-time audio/video/data applications. It allows you to build real-time apps without worrying about scaling or regions. It can act as a selective forwarding unit (WebRTC SFU), as a fanout delivery system for broadcasting (WebRTC CDN) or anything in between.
Cloudflare Realtime is a comprehensive suite of products designed to help you build powerful, scalable real-time applications. It has three main offerings:

Cloudflare Realtime runs on [Cloudflare's global cloud network](https://www.cloudflare.com/network/) in hundreds of cities worldwide.
### RealtimeKit

<LinkButton variant="primary" href="/realtime/get-started/">
Cloudflare [RealtimeKit](/realtime/introduction) allows you to integrate programmable and easily customizable live video and voice into your web, mobile, and desktop applications. With just a few lines of code, you can enable live video communication, voice calls, and interactive live streaming.

At its core, RealtimeKit is powered by the [Realtime SFU](/realtime/sfu), which efficiently routes video and audio streams between participants. RealtimeKit provides a set of user-friendly SDKs and APIs that act as a layer on top of the SFU, so you don't have to handle the complexities of media track management, peer management, and other intricate WebRTC-related tasks.

### Realtime SFU

The [Realtime SFU (Selective Forwarding Unit)](/realtime/sfu) is a powerful media server that efficiently routes video and audio streams between participants, and underpins the RealtimeKit. The Realtime SFU runs on [Cloudflare's global cloud network](https://www.cloudflare.com/network/) in hundreds of cities worldwide. For developers with WebRTC expertise, the SFU can be used independently to build highly custom applications that require full control over media streams. This is recommended only for those who want to leverage Cloudflare's network with their own WebRTC logic.

### TURN Service

The [TURN service](/realtime/turn) is a managed service that acts as a relay for WebRTC traffic. It ensures connectivity for users behind restrictive firewalls or NATs by providing a public relay point for media streams.

<LinkButton variant="primary" href="/realtime/getting-started/">
Get started
</LinkButton>
<LinkButton
variant="secondary"
href="https://dash.cloudflare.com/?to=/:account/calls"
href="https://dash.cloudflare.com/?to=/:account/realtime"
>
Realtime dashboard
</LinkButton>
<LinkButton variant="secondary" href="https://github.com/cloudflare/orange">
Orange Meets demo app
<LinkButton variant="secondary" href="https://demo.realtime.cloudflare.com">
RealtimeKit demo app
</LinkButton>

## Related products

<RelatedProduct header="Workers AI" href="/workers-ai/" product="workers-ai">

Run machine learning models, powered by serverless GPUs, on Cloudflare’s global network.

</RelatedProduct>

<RelatedProduct header="Stream" href="/stream/" product="stream">

Cloudflare Stream lets you or your end users upload, store, encode, and deliver live and on-demand video with one API, without configuring or maintaining infrastructure.

</RelatedProduct>

## More resources

<CardGrid>

<LinkTitleCard
title="Developer Discord"
href="https://discord.cloudflare.com"
icon="discord"
>
Connect with the Realtime community on Discord to ask questions, show what you
are building, and discuss the platform with other developers.
</LinkTitleCard>

<LinkTitleCard
title="Use cases"
href="/realtime/introduction#use-cases"
icon="document"
>
Learn how you can build and deploy ambitious Realtime applications to
Cloudflare's global network.
</LinkTitleCard>

<LinkTitleCard
title="@CloudflareDev"
href="https://x.com/cloudflaredev"
icon="x.com"
>
Follow @CloudflareDev on Twitter to learn about product announcements, and
what is new in Cloudflare Workers.
</LinkTitleCard>

</CardGrid>
Loading
Loading