Function: issueRoomfulToken()
@roomful/next / issueRoomfulToken
Function: issueRoomfulToken()
Section titled “Function: 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.
Parameters
Section titled “Parameters”options
Section titled “options”The signing secret and claim configuration.
Returns
Section titled “Returns”Promise<string>
The compact JWT string.
Throws
Section titled “Throws”When secret is empty.