Skip to main content

Generate Room Token

Generate Room Token

Takes an access key and a room id and creates a room token that is used to join a room. In production this should be done in a protected environment, e.g. your authentication server (see example project `Token Server´)

Inputs

NameTypeDescription
Execexec
TargetobjectUse the Construct Token Generator node to generate a token generator.
Room IdstringThe room id to generate a token for. Every user connected to the same room can talk to each other and exchange data.
User IdstringThe user id to generate a token for. You can use any string that makes sense for you to connect Odin peers to your users.
Token AudienceenumThe enum value of the token audience. Possible values are Default (for using a gateway) or Single Server (for using a specific Odin server without a gateway).

Outputs

NameTypeDescription
Execexec
Return ValuestringReturns a room token that can be used to join a room.