@videosdk.live/server-sdk
    Preparing search index...

    Interface GenerateTokenOptions

    Options for generateToken.

    The VideoSDK API authenticates server requests with a JWT that is HS256-signed with the project secretKey and carries the public apikey in its payload. This SDK signs the token locally — no network call.

    interface GenerateTokenOptions {
        apiKey: string;
        claims?: Record<string, unknown>;
        expiresIn?: string | number;
        permissions?: string[];
        roles?: string[];
        secretKey: string;
        version?: number;
    }
    Index
    apiKey: string

    The project API key (public). Embedded in the payload as apikey.

    claims?: Record<string, unknown>

    Extra custom claims merged into the payload (e.g. participantId, roomId).

    expiresIn?: string | number

    Expiry. Either a number of seconds, or a duration string such as "10m", "24h", "7d". Defaults to "24h".

    permissions?: string[]

    Permission claims. Defaults to ["allow_join", "allow_mod"]. Only relevant for RTC join flows; harmless for management calls.

    roles?: string[]

    Role claims. Defaults to the role the v2 REST APIs require for server-side (management) requests.

    secretKey: string

    The project secret key (private). Used to HS256-sign the token. Never sent over the wire.

    version?: number

    Token version. Defaults to 2, which the v2 REST APIs require. Pass undefined/null via claims only if you deliberately want a versionless token.