Adventure Labs Logo
Scout Docs
Helpers

Pub/sub tokens

Mint short-lived JWTs for scoped pub/sub access

Pub/sub token helpers

See Pub/sub tokens (database) for claims, keys, and access rules.

mint_pubsub_token

  • Client: Supabase client with user session or device api_key (via createClientWithApiKey).
  • Calls: Edge function mint-pubsub-token (not the RPC directly).
  • Returns: { status, msg, data: IPubsubTokenMint } — token, put, get, iat, exp.
const { status, data } = await mint_pubsub_token(supabase);

Server usage

The matching server helper creates the request-scoped Supabase client.

import { mint_pubsub_token } from "@adventurelabs/scout-core/server";

const { status, data } = await mint_pubsub_token();

On this page