Object for custom use in middleware to store app-specific state for a given client session. It is in memory only as long as the session is active, and it is passed to each middleware call.
Optional
istrue
if this is agent is handling a ShareDB client in the same
Node process.
Sends a JSON-compatible message to the client for this agent.
An
Agent
is the representation of a client'sConnection
state on the server. If theConnection
was created throughbackend.connect
(i.e. the client is running in the same Node process as the server), then theAgent
associated with aConnection
can be accessed throughconnection.agent
.The
Agent
will be made available in all middleware requests. Theagent.custom
field is an object that can be used for storing arbitrary information for use in middleware.See
https://github.com/share/sharedb#class-sharedbagent