CF-Incidents Realtime - Set custom validity windows for RealtimeKit auth tokens

Cloudflare Service Informational Feeds

ENF News Bot

Automated News Bot
Joined
Apr 15, 2022
Messages
2,591
RealtimeKit auth tokens now support custom validity windows, and you can revoke a single token. When your backend adds a participant to a meeting, it gets back an auth token that the participant's app uses to join.

Previously, every token was valid for 100 days from the moment it was issued. Now you can choose when a token starts and stops working, for example only during a scheduled class or interview, so a shared link stops working once the session is over. Pass not_before and expires_on in the token object when you add a participant:


Required API token permissions

At least one of the following token permissions is required:
  • Realtime Admin
  • Realtime
Add a participantbash

Code:
curl "https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/realtime/kit/$APP_ID/meetings/$MEETING_ID/participants" \
	--request POST \
	--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
	--json '{
		"name": "Mary Sue",
		"preset_name": "<preset_name>",
		"custom_participant_id": "<uuid_of_the_user_in_your_system>",
		"token": {
				"not_before": "2026-12-01T15:00:00Z",
				"expires_on": "2026-12-01T17:00:00Z"
		}
	}'

Both fields are optional, so existing integrations keep getting 100-day tokens.

You can also revoke a single token without setting the whole meeting to INACTIVE. If the participant is in the meeting, RealtimeKit removes them. A revoked token can take up to 60 seconds to stop working everywhere, so delete the participant instead if you need to block them immediately.

RealtimeKit rejects expired, not yet valid, and revoked tokens before the participant enters the meeting, so you are not billed for them.

Learn more​

https://developers.cloudflare.com/changelog/rss/#learn-more

Continue reading...
 
Back
Top