### Initialize and Listen for App Service Events Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/index.html Sets up an application service instance to listen for events and handle user or alias queries. ```javascript const { AppService } = require("matrix-appservice"); // listening const as = new AppService({ homeserverToken: "abcd653bac492087d3c87" }); as.on("type:m.room.message", (event) => { // handle the incoming message }); as.onUserQuery = function(userId, callback) { // handle the incoming user query then respond console.log("RECV %s", userId); callback(); }; // can also do this as a promise as.onAliasQuery = async function(alias) { console.log("RECV %s", alias); }; as.listen(8010); ``` -------------------------------- ### Constructor: new AppService Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppService.html Initializes a new instance of the AppService class with the required configuration. ```APIDOC ## Constructor: new AppService ### Description Constructs a new application service instance. ### Parameters #### Request Body - **config** (object) - Required - Configuration for this service. - **homeserverToken** (string) - Required - The incoming HS token to expect. - **httpMaxSizeBytes** (number) - Optional - The max number of bytes allowed on an incoming HTTP request. Default: 5000000. ``` -------------------------------- ### listen Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppService.html Begins listening on the specified port for incoming connections. ```APIDOC ## listen ### Description Begin listening on the specified port. ### Parameters #### Path Parameters - **port** (number) - Required - The port to listen on. - **hostname** (string) - Required - Optional hostname to listen on - **backlog** (number) - Required - Maximum length of the queue of pending connections - **callback** (function) - Optional - The callback for the "listening" event. ### Response #### Success Response (200) - **result** (undefined | Promise) - When the server is listening, if a callback is not provided. ``` -------------------------------- ### Create an App Service Registration File Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/index.html Generates a YAML registration file required for the homeserver to recognize the application service. ```javascript const { AppServiceRegistration } = require("matrix-appservice"); // creating registration files const reg = new AppServiceRegistration(); reg.setAppServiceUrl("http://localhost:8010"); reg.setHomeserverToken(AppServiceRegistration.generateToken()); reg.setAppServiceToken(AppServiceRegistration.generateToken()); reg.setSenderLocalpart("example-appservice"); reg.addRegexPattern("users", "@.*", true); reg.setProtocols(["exampleservice"]); // For 3PID lookups reg.outputAsYaml("registration.yaml"); ``` -------------------------------- ### Constructor: AppServiceRegistration Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Initializes a new instance of the AppServiceRegistration class. ```APIDOC ## constructor AppServiceRegistration ### Description Initializes a new instance of the AppServiceRegistration class. ### Method constructor ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) N/A #### Response Example None ### Parameters #### url - **url** (null | string) - The URL for the homeserver. ``` -------------------------------- ### Configuration Methods Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Methods for configuring the application service registration details. ```APIDOC ## setAppServiceToken ### Description Set the token the app service will use to communicate with the homeserver. ### Parameters #### Request Body - **token** (string) - Required - The token ## setAppServiceUrl ### Description Set the URL which the home server will hit in order to talk to the AS. ### Parameters #### Request Body - **url** (string) - Required - The application service url ## setHomeserverToken ### Description Set the token the homeserver will use to communicate with the app service. ### Parameters #### Request Body - **token** (string) - Required - The token ## setId ### Description Set the ID of the appservice; must be unique across the homeserver and never change. ### Parameters #### Request Body - **id** (string) - Required - The ID ## setProtocols ### Description Set the list of protocols that this appservice will serve for third party lookups. ### Parameters #### Request Body - **protocols** (string[]) - Required - The protocols ## setRateLimited ### Description Set whether requests from this AS are rate-limited by the home server. ### Parameters #### Request Body - **isRateLimited** (boolean) - Required - The flag which is set to true to enable rate rate limiting, false to disable. ## setSenderLocalpart ### Description Set the desired user_id localpart for the app service itself. ### Parameters #### Request Body - **localpart** (string) - Required - The user_id localpart ("alice" in "@alice:domain") ``` -------------------------------- ### Method: outputAsYaml Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Outputs the current registration details to a YAML file. ```APIDOC ## outputAsYaml ### Description Outputs the current registration details to a YAML file. ### Method outputAsYaml ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **return value** (void) - This method does not return a value. #### Response Example None ### Throws If required fields hs_token, as_token, or url are missing. ### Parameters #### filename - **filename** (string) - Required - The name of the file to write the YAML output to. ``` -------------------------------- ### Method: getOutput Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Retrieves the key-value output that should be written to a YAML file for the registration. ```APIDOC ## getOutput ### Description Retrieves the key-value output that should be written to a YAML file for the registration. ### Method getOutput ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (200) - **return value** (AppServiceOutput) - An object containing the registration details in a key-value format. #### Response Example None ### Throws If required fields hs_token, as-token, url, sender_localpart are missing. ``` -------------------------------- ### Method: setHomeserverToken Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Sets the token that the homeserver will use to communicate with the app service. ```APIDOC ## setHomeserverToken ### Description Sets the token that the homeserver will use to communicate with the app service. ### Method setHomeserverToken ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **return value** (void) - This method does not return a value. #### Response Example None ### Parameters #### token - **token** (string) - Required - The token to set for homeserver to app service communication. ``` -------------------------------- ### Utility and State Methods Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Methods for checking ephemeral event status and registration object utilities. ```APIDOC ## pushEphemeralEnabled ### Description Should the appservice receive ephemeral events. Note this requires a homeserver implementing MSC2409. ### Response - **returns** (boolean) ## fromObject ### Description Convert a JSON object to an AppServiceRegistration object. ### Parameters #### Request Body - **obj** (AppServiceOutput) - Required - The registration object ### Response - **returns** (AppServiceRegistration) - The registration. ## generateToken ### Description Generate a random token. ### Response - **returns** (string) - A randomly generated token. ``` -------------------------------- ### Events: on Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppService.html Describes the events emitted by the AppService instance when receiving data from the homeserver. ```APIDOC ## Event: on ### Description Registers listeners for events pushed to the appservice. ### Events - **event** - Emitted when a standard event is pushed. - **ephemeral** - Emitted when an ephemeral event is pushed. - **http-log** - Emitted when the HTTP listener logs information. - **type:[event_type]** - Emitted when an event of a specific type is pushed. ``` -------------------------------- ### Method: addRegexPattern Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Adds a regex pattern to the registration for users, aliases, or rooms. ```APIDOC ## addRegexPattern ### Description Adds a regex pattern to the registration for users, aliases, or rooms. ### Method addRegexPattern ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **return value** (void) - This method does not return a value. #### Response Example None ### Throws If given an invalid type or regex. ### Parameters #### type - **type** (users | aliases | rooms) - Required - The type of regex pattern. Must be 'users', 'rooms', or 'aliases'. #### regex - **regex** (string) - Required - The regex pattern. #### exclusive - **exclusive** (boolean) - Optional - True to reserve the matched namespace. ``` -------------------------------- ### Method: getAppServiceUrl Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Retrieves the URL which the homeserver will use to communicate with the app service. ```APIDOC ## getAppServiceUrl ### Description Retrieves the URL which the homeserver will use to communicate with the app service. ### Method getAppServiceUrl ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (200) - **return value** (null | string) - The URL for homeserver to app service communication. #### Response Example None ``` -------------------------------- ### Static Event Utilities Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppService.html Static utility methods for handling event emitters and asynchronous event streams. ```APIDOC ## listenerCount ### Description Returns the number of listeners for a specific event on an emitter. (Deprecated since v4.0.0) ### Parameters - **emitter** (EventEmitter) - Required - The event emitter instance. - **event** (string | symbol) - Required - The event name. ### Returns - **number** - The count of listeners. ## on ### Description Creates an AsyncIterableIterator for an event on an emitter. ### Parameters - **emitter** (EventEmitter) - Required - The event emitter instance. - **event** (string) - Required - The event name. ### Returns - **AsyncIterableIterator** - An async iterator for the event. ## once ### Description Returns a promise that resolves when the specified event is emitted once. ### Parameters - **emitter** (NodeEventTarget | DOMEventTarget) - Required - The event emitter. - **event** (string | symbol) - Required - The event name. ### Returns - **Promise** - A promise resolving with event data. ``` -------------------------------- ### Method: getProtocols Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Retrieves the list of protocols that this appservice will serve for third-party lookups. ```APIDOC ## getProtocols ### Description Retrieves the list of protocols that this appservice will serve for third-party lookups. ### Method getProtocols ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (200) - **return value** (null | string[]) - An array of protocol names, or null if no protocols have been set. #### Response Example None ``` -------------------------------- ### AppServiceRegistration Class Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Provides methods for configuring and retrieving application service registration details. ```APIDOC ## Class AppServiceRegistration ### Hierarchy * AppServiceRegistration ### Constructors * constructor ### Properties * pushEphemeral ### Methods * _isMatch * addRegexPattern * getAppServiceToken * getAppServiceUrl * getHomeserverToken * getId * getOutput * getProtocols * getSenderLocalpart * isAliasMatch * isRateLimited * isRoomMatch * isUserMatch * outputAsYaml * pushEphemeralEnabled * setAppServiceToken * setAppServiceUrl * setHomeserverToken * setId * setProtocols * setRateLimited * setSenderLocalpart * fromObject * generateToken ``` -------------------------------- ### Method: setAppServiceUrl Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Sets the URL which the homeserver will use to communicate with the app service. ```APIDOC ## setAppServiceUrl ### Description Sets the URL which the homeserver will use to communicate with the app service. ### Method setAppServiceUrl ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **return value** (void) - This method does not return a value. #### Response Example None ### Parameters #### url - **url** (string) - Required - The URL for homeserver to app service communication. ``` -------------------------------- ### Handle HTTP logs Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppService.html Registers a listener for HTTP log output from the service. ```javascript appService.on("http-log", function(line) { console.log(line); }); ``` -------------------------------- ### Method: getAppServiceToken Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Retrieves the token that the app service will use to communicate with the homeserver. ```APIDOC ## getAppServiceToken ### Description Retrieves the token that the app service will use to communicate with the homeserver. ### Method getAppServiceToken ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (200) - **return value** (null | string) - The token used for app service to homeserver communication. #### Response Example None ``` -------------------------------- ### AppService Methods Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppService.html Methods available on the AppService instance for configuration and event management. ```APIDOC ## setMaxListeners ### Description Sets the maximum number of listeners for the AppService instance. ### Parameters - **n** (number) - Required - The maximum number of listeners. ### Returns - **AppService** - The AppService instance. ``` -------------------------------- ### Method: setProtocols Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Sets the list of protocols that this appservice will serve for third-party lookups. ```APIDOC ## setProtocols ### Description Sets the list of protocols that this appservice will serve for third-party lookups. ### Method setProtocols ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **return value** (void) - This method does not return a value. #### Response Example None ### Parameters #### protocols - **protocols** (string[]) - Required - An array of protocol names to serve. ``` -------------------------------- ### onUserQuery Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppService.html Override this method to handle user queries. ```APIDOC ## onUserQuery ### Description Override this method to handle user queries. ### Parameters #### Path Parameters - **userId** (string) - Required - The queried user ID. - **callback** (function) - Required - The callback to invoke when complete. ### Response #### Success Response (200) - **result** (null | PromiseLike) - A promise to resolve when complete (if callback isn't supplied) ``` -------------------------------- ### Method: setRateLimited Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Sets whether requests from this app service should be rate-limited by the homeserver. ```APIDOC ## setRateLimited ### Description Sets whether requests from this app service should be rate-limited by the homeserver. ### Method setRateLimited ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **return value** (void) - This method does not return a value. #### Response Example None ### Parameters #### rateLimited - **rateLimited** (boolean) - Required - True to enable rate limiting, false otherwise. ``` -------------------------------- ### Handle Matrix events Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppService.html Registers a listener for incoming Matrix events. ```javascript appService.on("event", function(ev) { console.log("ID: %s", ev.event_id); }); ``` -------------------------------- ### Method: _isMatch Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Checks if a given sample string matches any of the provided regex patterns. ```APIDOC ## _isMatch ### Description Checks if a given sample string matches any of the provided regex patterns. ### Method _isMatch ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **return value** (boolean) - True if the sample matches any regex, false otherwise. #### Response Example None ### Parameters #### regexList - **regexList** (undefined | RegexObj[]) - A list of regex objects to match against. #### sample - **sample** (string) - The string to test for a match. #### onlyExclusive - **onlyExclusive** (boolean) - If true, only exclusive regexes will be considered for matching. ``` -------------------------------- ### Method: setAppServiceToken Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Sets the token that the app service will use to communicate with the homeserver. ```APIDOC ## setAppServiceToken ### Description Sets the token that the app service will use to communicate with the homeserver. ### Method setAppServiceToken ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **return value** (void) - This method does not return a value. #### Response Example None ### Parameters #### token - **token** (string) - Required - The token to set for app service to homeserver communication. ``` -------------------------------- ### Method: getHomeserverToken Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Retrieves the token that the homeserver will use to communicate with the app service. ```APIDOC ## getHomeserverToken ### Description Retrieves the token that the homeserver will use to communicate with the app service. ### Method getHomeserverToken ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (200) - **return value** (null | string) - The token used for homeserver to app service communication. #### Response Example None ``` -------------------------------- ### Method: isRateLimited Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Determines if requests from this app service are rate-limited by the homeserver. ```APIDOC ## isRateLimited ### Description Determines if requests from this app service are rate-limited by the homeserver. ### Method isRateLimited ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (200) - **return value** (boolean) - True if rate limiting is enabled, false otherwise. #### Response Example None ``` -------------------------------- ### setHomeserverToken Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppService.html Set the token that should be used to verify incoming events. ```APIDOC ## setHomeserverToken ### Description Set the token that should be used to verify incoming events. ### Parameters #### Path Parameters - **hsToken** (string) - Required - The token to set. ``` -------------------------------- ### Handle specific event types Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppService.html Registers a listener for a specific event type, such as m.room.message. ```javascript appService.on("type:m.room.message", function(event) { console.log("ID: %s", ev.content.body); }); ``` -------------------------------- ### Accessor: expressApp Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppService.html Provides access to the underlying Express application instance. ```APIDOC ## Accessor: expressApp ### Description Returns the Express App instance for the appservice, which can be extended with custom paths. ### Returns - **Application** - The Express application instance. ``` -------------------------------- ### RegexObj Interface Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/interfaces/RegexObj.html Details about the RegexObj interface, including its hierarchy and properties. ```APIDOC ## Interface RegexObj ### Hierarchy * RegexObj ## Properties ### exclusive exclusive: boolean ### regex regex: string ``` -------------------------------- ### Property: pushEphemeral Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Experimental property to signal to the homeserver that this appservice will accept ephemeral events. ```APIDOC ## Property pushEphemeral ### Description Experimental property to signal to the homeserver that this appservice will accept ephemeral events. ### Type undefined | boolean ### Default Value undefined ``` -------------------------------- ### Method: getId Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Retrieves the unique ID of the application service. ```APIDOC ## getId ### Description Retrieves the unique ID of the application service. ### Method getId ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (200) - **return value** (null | string) - The ID of the application service. #### Response Example None ``` -------------------------------- ### onAliasQuery Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppService.html Override this method to handle alias queries. ```APIDOC ## onAliasQuery ### Description Override this method to handle alias queries. ### Parameters #### Path Parameters - **alias** (string) - Required - The queried room alias - **callback** (function) - Required - The callback to invoke when complete. ### Response #### Success Response (200) - **result** (null | PromiseLike) - A promise to resolve when complete (if callback isn't supplied) ``` -------------------------------- ### Method: isRoomMatch Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Checks if a given room ID matches any of the registered regex patterns for rooms. ```APIDOC ## isRoomMatch ### Description Checks if a given room ID matches any of the registered regex patterns for rooms. ### Method isRoomMatch ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **return value** (boolean) - True if the room ID matches a registered pattern, false otherwise. #### Response Example None ### Parameters #### roomId - **roomId** (string) - Required - The room ID to check. #### onlyExclusive - **onlyExclusive** (boolean) - Required - If true, only exclusive regexes will be considered for matching. If false, both exclusive and non-exclusive regexes will be considered. ``` -------------------------------- ### Method: setId Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Sets the unique ID of the application service. ```APIDOC ## setId ### Description Sets the unique ID of the application service. ### Method setId ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **return value** (void) - This method does not return a value. #### Response Example None ### Parameters #### id - **id** (string) - Required - The unique ID for the application service. ``` -------------------------------- ### close Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppService.html Closes the HTTP server. ```APIDOC ## close ### Description Closes the HTTP server. ### Response #### Success Response (200) - **result** (Promise) - When the operation has completed ``` -------------------------------- ### Method: isAliasMatch Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Checks if a given room alias matches any of the registered regex patterns for aliases. ```APIDOC ## isAliasMatch ### Description Checks if a given room alias matches any of the registered regex patterns for aliases. ### Method isAliasMatch ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **return value** (boolean) - True if the alias matches a registered pattern, false otherwise. #### Response Example None ### Parameters #### alias - **alias** (string) - Required - The room alias to check. #### onlyExclusive - **onlyExclusive** (boolean) - Required - If true, only exclusive regexes will be considered for matching. If false, both exclusive and non-exclusive regexes will be considered. ``` -------------------------------- ### Handle ephemeral events Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppService.html Registers a listener for incoming ephemeral events. ```javascript appService.on("ephemeral", function(ev) { console.log("ID: %s", ev.type); }); ``` -------------------------------- ### Method: getSenderLocalpart Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Retrieves the desired user ID localpart for the app service itself. ```APIDOC ## getSenderLocalpart ### Description Retrieves the desired user ID localpart for the app service itself. ### Method getSenderLocalpart ### Endpoint N/A ### Parameters None ### Request Example None ### Response #### Success Response (200) - **return value** (null | string) - The localpart of the user ID (e.g., "alice" in "@alice:domain"). #### Response Example None ``` -------------------------------- ### Method: isUserMatch Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Checks if a given user ID matches any of the registered regex patterns for users. ```APIDOC ## isUserMatch ### Description Checks if a given user ID matches any of the registered regex patterns for users. ### Method isUserMatch ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **return value** (boolean) - True if the user ID matches a registered pattern, false otherwise. #### Response Example None ### Parameters #### userId - **userId** (string) - Required - The user ID to check. #### onlyExclusive - **onlyExclusive** (boolean) - Required - If true, only exclusive regexes will be considered for matching. If false, both exclusive and non-exclusive regexes will be considered. ``` -------------------------------- ### Method: setSenderLocalpart Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/classes/AppServiceRegistration.html Sets the desired user ID localpart for the app service itself. ```APIDOC ## setSenderLocalpart ### Description Sets the desired user ID localpart for the app service itself. ### Method setSenderLocalpart ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **return value** (void) - This method does not return a value. #### Response Example None ### Parameters #### senderLocalpart - **senderLocalpart** (string) - Required - The localpart for the app service's user ID. ``` -------------------------------- ### Interface AppServiceOutput Source: https://matrix-org.github.io/matrix-appservice-node/1.0.0/interfaces/AppServiceOutput.html Defines the structure of the AppServiceOutput object used for application service configuration. ```APIDOC ## Interface AppServiceOutput ### Properties - **as_token** (string) - Required - The application service token. - **hs_token** (string) - Required - The homeserver token. - **id** (string) - Required - The unique identifier for the application service. - **sender_localpart** (string) - Required - The localpart of the application service user. - **url** (null | string) - Required - The URL of the application service. - **de.sorunome.msc2409.push_ephemeral** (boolean) - Optional - Push ephemeral events flag. - **namespaces** (object) - Optional - Configuration for aliases, rooms, and users namespaces. - **protocols** (null | string[]) - Optional - List of supported protocols. - **rate_limited** (boolean) - Optional - Whether the application service is rate limited. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.