GitHub

Source

useToken

The useToken hook fetches a token from the given token endpoint with the given user info.

Import

import { useToken } from "@livekit/components-react";

Usage

const token = useToken(<token-endpoint>, roomName, { userInfo: { identity, name }});

Properties

roomNamestring
tokenEndpointstring | undefined
options?UseTokenOptions

Returns

string | undefined;