useSession
function useSession(tokenSource): UseSessionReturn;Defined in: packages/react/src/hooks/session/useSession.ts:26
Note. This feature is under active development and may change based on developer feedback and real-world usage. A Session represents a managed connection to a Room which can contain Agents.
Parameters
| Parameter | Type |
|---|---|
tokenSource | unknown |
Returns
Example
const session = useSession({ token: "local" });
return <span>{session.connectionState}</span>;