0.13.7-5 • Published 1 year ago

dendrite-dist v0.13.7-5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

dendrite-dist

Use dendrite as an npm module for tighter integration with node apps (e.g. test fixtures). See the dendrite documentation for usage: https://matrix-org.github.io/dendrite/.

Usage

npm install dendrite-dist

Put a dendrite.yaml in the current working directory.

import dendrite, {initMatrixKey, initTLSKey, createUser} from "dendrite-dist"

// This will create keys
const matrixKey = await initMatrixKey()
await writeFile('matrix_key.pem', matrixKey)

const {key, crt} = await initTLSKey()
await writeFile('server.crt', crt)
await writeFile('server.key', key)

// Then start the server
const server = await dendrite()
await createUser(['--config', 'dendrite.yaml', '--username', 'testuser', '--password', 'testpassword'])
server.stop()