Skip to content

Function: issueRoomfulToken()

@roomful/next


@roomful/next / issueRoomfulToken

issueRoomfulToken(options): Promise<string>

Defined in: packages/next/src/index.ts:196

Mints a relay-compatible HS256 JWT server-side using Web Crypto.

The token format matches what @roomful/relay’s verifyJWT accepts: a compact base64url(header).base64url(payload).base64url(signature) string signed with HMAC-SHA256. Run it on a server (Node) or in the Edge runtime to issue room-scoped tokens to clients without shipping the relay secret to the browser.

IssueRoomfulTokenOptions

The signing secret and claim configuration.

Promise<string>

The compact JWT string.

When secret is empty.