OptionalcloudCloud token for AI features (optional)
OptionalgenerateFetches a fresh room token from your server. Room tokens expire after a
day; when the room needs to re-mint a session past that boundary it calls
this instead of re-using roomToken. Provide it for sessions that can
outlive the token (a tab left open overnight). Without it, the room keeps
working for the token's lifetime and must be reloaded afterwards.
OptionalgenerateFetches a cloud token for AI features from your backend.
Called lazily on the first AI request, and again when the token expires.
The SDK passes { userId } so the callback can forward it: the
cloud-token endpoint identifies the user by email address, and rejects a
request for someone who does not exist in your organization's identity
system. Return the token, or { cloudToken, environment } to let the
client detect which environment issued it.
The parameter and return shapes mirror @hiyve/cloud's
GenerateCloudTokenParams and CloudTokenResponse, but are written out
here rather than imported: @hiyve/cloud is an optional peer, and a type
import would make it required for anyone type-checking this package.
OptionalintelligenceEnable intelligence features (requires cloudToken or generateToken)
OptionalregionSignaling region to pin the connection to (e.g. 'us-east-2').
Must match the SERVER_REGION your token server minted the room token
for. Without a pin the client picks a region itself, and a token
presented to a stack that did not sign it is rejected — the join fails
with a generic "Internal server error". Forwarded to HiyveProvider.
Room token from signaling server
OptionaluserUser ID for cloud features
Children to render inside providers