Options to pass to the bridge
Install a custom handler for an incoming HTTP API request. This allows callers to add extra functionality, implement new APIs, etc...
Named options
Should the token be automatically checked. Defaults to true.
Function to handle requests to this endpoint.
The HTTP method name.
Path to the endpoint.
Determines whether a room should be provisoned based on user provided rules and the room state. Will default to true if no rules have been provided.
The room to check.
Should the validator check it's cache.
resolves if can and rejects if it cannot. A status code is returned on both.
Close the appservice HTTP listener, and clear all timeouts.
Resolves when the appservice HTTP listener has stopped
Get the AS bot instance.
Retrieve the matrix client factory used when sending matrix requests.
Retrieve the connected event store instance, if one was configured.
Retrieve an Intent instance for the specified user ID. If no ID is given, an instance for the bot itself is returned.
Optional. The user ID to get an Intent for.
Optional. The request instance to tie the MatrixClient instance to. Useful for logging contextual request IDs.
The intent instance
Retrieve an Intent instance for the specified user ID localpart. This must be the complete user localpart.
The user ID localpart to get an Intent for.
Optional. The request instance to tie the MatrixClient instance to. Useful for logging contextual request IDs.
The intent instance
Returns a PrometheusMetrics instance stored on the bridge, creating it first if required. The instance will be registered with the HTTP server so it can serve the "/metrics" page in the usual way. The instance will automatically register the Matrix SDK metrics by calling {PrometheusMetrics~registerMatrixSdkMetrics}.
Register the /metrics endpoint on the appservice HTTP server. Defaults to true.
Optionally provide an alternative registry for metrics.
Retrieve the request factory used to create incoming requests.
Retrieve the connected room store instance.
Retrieve the connected user store instance.
Load the user and room databases. Access them via getUserStore() and getRoomStore().
Check the homeserver -> appservice connection by sending a ping event.
The room to use as a ping check.
How long to wait for the ping attempt. Defaults to 60s.
The delay in milliseconds
Provision a user on the homeserver.
The virtual user to be provisioned.
Provisioning information.
Resolved when provisioned.
A convenient shortcut to calling registerBridgeGauges() on the PrometheusMetrics instance directly. This version will supply the value of the matrixGhosts field if the counter function did not return it, for convenience.
A function that when invoked returns the current counts of various items in the bridge.
Check a express Request to see if it's correctly
authenticated (includes the hsToken). The query parameter access_token
and the Authorization
header are checked.
True if authenticated, False if not.
Run the bridge (start listening)
The port to listen on.
Configuration options
The AppService instance to attach to. If not provided, one will be created.
Optional hostname to bind to. (e.g. 0.0.0.0)
A promise resolving when the bridge is ready
Generated using TypeDoc