Skip to content

Latest commit

 

History

History
 
 

matrix-application-server

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

@twake/matrix-application-server

Node.js library that implements Matrix Application Service API.

Synopsis

Example using express:

import express from 'express'
import AppServer from '@twake/matrix-application-server'

// if configuration is in default file (/etc/twake/as-server.conf)
const appServer = new AppServer()

// else if configuration is in a different file, set TWAKE_AS_SERVER_CONF
process.env.TWAKE_AS_SERVER_CONF = '/path/to/config/file'
const appServer = new AppServer()

// You can also give configuration directly
const appServer = new AppServer(config)

const app = express()

app.use(appServer.router.routes)
app.listen(3000)

This module will be requested by the matrix homeserver each time the homeserver will receive a request intended for a room or a user whose id or alias matches one of the application server namespaces regexes. The matrix-application-server module should be extended to handle event received from matrix homeserver.

See https://github.com/matrix-org/matrix-appservice-bridge for a full complex example

Configuration file

Configuration file is a JSON file. The default values are in src/config.json.

Copyright and license

Copyright (c) 2023-present Linagora https://linagora.com

License: GNU AFFERO GENERAL PUBLIC LICENSE