Constructs a new ConvergenceDomain using the default options.
The url of the convergence domain to connect to.
Options that configure how the convergence domain is configured.
Gets the ActivityService, which is used for interacting with Activities.
const activityService = domain.activities();
The ActivityService from this ConvergenceDomain.
Adds a new event listener for the specified event. The class will ignore duplicate registrations of the same listener to the same event.
The name of the event to add the listener for.
The listener callback to register.
This object, in support of a fluent API.
Gets the ChatService, which is used to send and receive chat messages.
The ChatService for this ConvergenceDomain.
Connects to a Convergence Domain using anonymous authentication.
The optional display name to use for the anonymous user. The display name can be supplied directly or can be supplied as a factory function that will return a promise to obtain it.
A Promise which will be resolved upon successful connection and authentication.
Connects to a Convergence Domain using a JSON Web Token (JWT) for authentication.
A valid JSON Web Token (JWT) indicating the Domain User to connect as. The JWT can be supplied directly or can be supplied as a factory function that will return a promise to obtain it.
A Promise which will be resolved upon successful connection and authentication.
Connects to a Convergence Domain using username / password authentication.
The username and password of the Convergence Domain User to connect as. The credentials can be supplied directly or can be supplied as a factory function that will return a promise to obtain them.
A Promise which will be resolved upon successful connection and authentication.
Disconnects from the server, if connected.
Disconnects from the server and releases all resources this domain is using. After calling dispose(), the domain will no longer be usable.
A promise that is resolved when the ConvergenceDomain is disposed.
Provides the events emitted by this object as an Observable stream.
An Observable stream of all events emitted by this object.
The unique ID of this domain.
Gets the IdentityService, which is used for obtaining information about Users.
const identityService = domain.identity();
The IdentityService for this ConvergenceDomain.
Initializes the domain without connecting to the server. The method must be provided the username of the normal domain user that will eventually connect as.
The username of the domain user to connect offline as.
A Promise that will be completed when the domain is ready to use.
Determines if the domain is connected.
true if the domain is connected; false otherwise.
Determines if the domain is disconnected.
true if the domain is disconnected; false otherwise.
Determines if this domain is disposed.
True if the domain is disposed; false otherwise.
Gets the ModelService, which is used for interacting with Real Time Models.
const modelService = domain.models();
The ModelService for this ConvergenceDomain.
The namespace of this domain.
Removes a single event listener for a specific event.
The name of the event to remove the listener for.
The listener callback to unregister.
This object, in support of a fluent API.
Adds a new event listener for the specified event. The class will ignore duplicate registrations of the same listener to the same event.
The name of the event to add the listener for.
The listener callback to register.
This object, in support of a fluent API.
Adds a single shot event listener for the specified event. The listener will be called the first time the specified event is fired after the event registration occurs, after which the registration will be removed and no further events will be passed to the listener.
The name of the event to add the listener for.
The listener callback to register.
This object, in support of a fluent API.
The resolved options for this domain.
Gets the PresenceService, which is used to gain insight into the presence of Domain Users.
The PresenceService for this ConvergenceDomain.
Reconnects to the specified domain using a previously generated reconnect token.
The reconnect token to use for authentication.
A Promise which will be resolved upon successful connection and authentication.
Removes all listeners for all events. This is useful for cleanup before disposing of this particular event emitter.
This object, in support of a fluent API.
Removes a single event listener for a specific event.
The name of the event to remove the listener for.
The listener callback to unregister.
This object, in support of a fluent API.
Removes all listeners bound on the given event.
the name of the event to remove listeners for
This object, in support of a fluent API.
Gets the server's current time. Callers should not that this will be an approximate time based on network latency between the client and server. A potential way to get a more accurate estimate would be to monitor the round trip time and decrease the response by half the round trip time. For example:
The current server time, at the time the server received the request.
The ConvergenceSession attached to this domain.
The url of the domain.
A list of all the events that could be emitted from a domain.
Emitted when the domain is actively attempting to authenticate. The actual emitted event is an AuthenticatingEvent.
Emitted when the domain successfully (re)connected to the server. The actual emitted event is a ConnectedEvent.
Emitted when the domain is actively attempting to connect to the server. The actual emitted event is a ConnectingEvent.
Emitted when a connection attempt failed. The actual emitted event is a ConnectionFailedEvent.
Emitted when the domain is scheduled to attempt to reconnect. The actual emitted event is a ConnectionScheduledEvent.
Emitted when the domain is currently disconnected and is not attempting to automatically reconnect. The actual emitted event is a DisconnectedEvent.
Emitted when the domain encountered an unexpected error. The actual emitted event is an ErrorEvent.
Emitted when the domain's connection was interrupted. This indicates that the domain is in a state where it is currently disconnected, but is automatically and continuously attempting to reconnect.
The actual emitted event is an InterruptedEvent.
This represents a single connection to a specific Domain in Convergence. All interactions with the Domain start with this class, through several "services" that provide the following functionality:
This object itself is the result of a successful connection and authentication to a Convergence server via one of the Convergence connection methods. Or, to begin working in an offline state, instantiate this class directly.
See the Events section for all the possible events that could be emitted from a domain.