UseSyncOptions
See source codeTable of contents
Options for the useSync hook.
interface UseSyncOptions {}
Properties
assets
The asset store for blob storage. See .
If you don't have time to implement blob storage and just want to get started, you can use the inline base64 asset store. Note that storing base64 blobs inline in JSON is very inefficient and will cause performance issues quickly with large images and videos.
assets: TLAssetStore
uri
The URI of the multiplayer server. This must include the protocol,
e.g. wss://server.example.com/my-room
or ws://localhost:5858/my-room
.
Note that the protocol can also be https
or http
and it will upgrade to a websocket
connection.
Optionally, you can pass a function which will be called each time a connection is established to get the URI. This is useful if you need to include e.g. a short-lived session token for authentication.
uri: (() => Promise<string> | string) | string
userInfo
A signal that contains the user information needed for multiplayer features.
This should be synchronized with the userPreferences
configuration for the main <Tldraw />
component.
If not provided, a default implementation based on localStorage will be used.
userInfo?: Signal<TLSyncUserInfo> | TLSyncUserInfo