Cloudflare.Calls reference
Source:
src/Cloudflare/Calls/App.ts
A Cloudflare Realtime (formerly “Calls”) SFU application.
An app is the unit of isolation for Cloudflare’s WebRTC SFU: clients
connect to sessions scoped to the app’s auto-assigned appId, and your
backend authenticates management calls with the create-only secret
(a bearer token). The only configurable property is the human-readable
name, which is mutable in place.
App: Creating an App
Section titled “App: Creating an App”App with a generated name
const app = yield* Cloudflare.Calls.App("realtime", {});App with an explicit name
const app = yield* Cloudflare.Calls.App("realtime", { name: "my-realtime-app",});App: Using the credentials
Section titled “App: Using the credentials”// appId is public — it appears in client session URLs:const appId = app.appId;
// The secret is redacted — use it server-side as a bearer token// against https://rtc.live.cloudflare.com/v1/apps/{appId}/...const secret = app.secret; // Redacted<string>TurnKey
Section titled “TurnKey”Source:
src/Cloudflare/Calls/TurnKey.ts
A Cloudflare Realtime (formerly “Calls”) TURN key.
A TURN key authenticates your backend against Cloudflare’s managed TURN
service: you exchange the create-only key (a bearer token) for
short-lived TURN credentials that WebRTC clients use to relay traffic
through Cloudflare’s network. The only configurable property is the
human-readable name, which is mutable in place.
TurnKey: Creating a TURN key
Section titled “TurnKey: Creating a TURN key”TURN key with a generated name
const turnKey = yield* Cloudflare.Calls.TurnKey("turn", {});TURN key with an explicit name
const turnKey = yield* Cloudflare.Calls.TurnKey("turn", { name: "my-turn-key",});TurnKey: Using the key
Section titled “TurnKey: Using the key”// keyId is public — it appears in the credential-minting URL:const keyId = turnKey.keyId;
// The key is redacted — POST it as a bearer token to// https://rtc.live.cloudflare.com/v1/turn/keys/{keyId}/credentials/generateconst apiToken = turnKey.key; // Redacted<string>