Docs/API reference/Realtime auth

Realtime auth

The endpoints the browser SDK calls to obtain connection and subscription tokens.

API· 4 min read

Endpoints

These endpoints live under /api/platform/emitwave/* and require an end-user Bearer token. The browser SDK calls them automatically; you rarely call them directly.

MethodPathPurpose
POST/api/platform/emitwave/connect-tokenMint a connection token for the socket
POST/api/platform/emitwave/channel-authAuthorize a private or presence channel

Connect token

POST/connect-token

connect() POSTs the public application key here with the end-user Bearer token. This is required for every connection, including connections that subscribe only to public channels. The response returns a short-lived connection token and the application ID used to scope channel names.

Channel authorization

POST/channel-auth

Private, private-cache, presence, presence-cache, and private-encrypted channels call this before subscribing. EmitWave evaluates the registered channel callback for the authenticated user. Private callbacks return a truthy value; presence callbacks return { id, info }; encrypted channels additionally receive a per-channel decryption key in the response. See Authentication.

Debug subscription

POST/api/platform/applications/{application}/debug-subscription

Platform tools can request an exact internal channel plus a channel-bound subscription token to inspect an application's live publish traffic. Pair both values and pass them to the SDK's subscribeWithToken(); the short-lived token only authorizes the exact returned channel. Access follows the application's view permission.

The debug stream is ephemeral: it shows only events published while open, keeps at most the newest 200 entries in browser memory, and has no server-side replay. Encrypted publishes appear as their encrypted wire envelope.