Overview
Realtime has two surfaces:- REST API for channel management, message history, delivery stats, permissions, and retention settings.
- Socket.IO for live subscribe, publish, presence, and delivered events.
The REST API does not stream messages. Use the Socket.IO connection, or the TypeScript SDK, for live events.
Authentication
Admin REST endpoints require a project-admin token or API key.auth object:
Socket.IO Pub/Sub
Install the Socket.IO client when you are not using the InsForge SDK:Connect And Subscribe
Listen For Events
Publish
Unsubscribe
Socket Events
Channel Patterns
Create channel definitions before clients subscribe.
Pattern matching uses SQL
LIKE, so % is the wildcard. _ is not accepted in channel patterns because it is also a SQL wildcard.
Channels
List Channels
Create Channel
Get Channel
Update Channel
Delete Channel
channelId values to null.
Messages
List Messages
Message Stats
retentionDays: null means messages are retained indefinitely.
Permissions
- Subscribe checks on
realtime.channels. - Publish checks on
realtime.messages.
Configuration
Get Realtime Config
Update Realtime Config
null to keep messages indefinitely. Positive integers retain messages for that many days.
Webhooks
When a channel haswebhookUrls, each message delivered through that channel is posted to each URL.
The request body is the original message payload. Headers identify the delivery:
Delivery attempts are reflected in
whAudienceCount and whDeliveredCount on message history.