PresenceAuthority
Class: PresenceAuthority
Defined in: index.ts:52
The PresenceAuthority manages most of Pitter Patter's server side presence operations.
You create endpoints that call the appropriate PresenceAuthority functions to integrate with a PresenceClient.
A PresenceAuthority is designed to be stateless, so you can create a new one on every server, lambda, or cloud function instance.
Constructors
Constructor
new PresenceAuthority(config: PresenceAuthorityConfig): PresenceAuthority;Defined in: index.ts:56
Parameters
config
Returns
PresenceAuthority
Methods
listenForPresence()
listenForPresence(
docId: string,
excludeClientId: string,
refs?: Record<string, string>): Promise<{
[k: string]: PresenceIndicator;
}>;Defined in: index.ts:73
Listens for remote changes to a document's presence state and returns when changes are found or
after a timeout specified in the PresenceAuthority's broadcastManager.
Parameters
docId
string
excludeClientId
string
refs?
Record<string, string> = {}
Returns
Promise<{ [k: string]:
PresenceIndicator; }>
updatePresence()
updatePresence(docId: string, indicator: PresenceIndicator): Promise<void>;Defined in: index.ts:64
Saves new presence state for a client and notifies and listeners of the update.
Parameters
docId
string
indicator
Returns
Promise<void>