Optionalopts: ClientOptionsthe options of the client.
activate activates this client. That is, it registers itself to the server
and receives a unique ID from the server. The given ID is used to
distinguish different clients.
attach attaches the given channel to this client. It tells the server that
this client will track the channel.
Optionalopts: AttachChannelOptionsattach attaches the given channel to this client.
It tells the server that this client will track the channel.
broadcast broadcasts the given payload to the given topic.
Optionaloptions: BroadcastOptionscreateRevision creates a new revision for the given document.
deactivate deactivates this client.
If keepalive is true, the client will request deactivation
immediately using fetch with the keepalive option enabled. This is
useful for ensuring the deactivation request completes even if the page is
being unloaded, such as in beforeunload or unload event listeners.
If synchronous is true, the server will wait for all pending operations to
complete before deactivating.
getCondition returns the condition of this client.
getID returns a ActorID of client.
getKey returns a key of client.
getRevision retrieves a specific revision by its ID with full snapshot data.
getStatus returns the status of this client.
has checks if the given resource is attached to this client.
the key of the resource.
true if the resource is attached to this client.
isActive checks if the client is active.
listRevisions lists all revisions for the given document.
peekChannel reads the current session count of a channel without
creating a session on the server. Use this when the caller only needs
to display the count (e.g. "N people writing") without contributing to
it and without receiving broadcasts.
Unlike attach({ readOnly: true }), this does not occupy a Session
entry on the server, does not generate heartbeat RPCs, and does not
subscribe to channel events. Polling is the caller's responsibility.
sync pushes local changes of the attached documents to the server and
receives changes of the remote replica from the server then apply them to
local documents.
For Channel in manual mode, it refreshes the TTL by sending a heartbeat.
Clientis a normal client that can communicate with the server. It has documents and sends changes of the documents in local to the server to synchronize with other replicas in remote.