1.0.13 • Published 4 years ago

@lorena-ssi/matrix-lib v1.0.13

Weekly downloads
15
License
MIT
Repository
github
Last release
4 years ago

matrix-lib

matrix-lib is a caelum api for matrix connection used in Lorena SSI.

Build Status Coverage Status

Installation

npm @lorena-ssi/matrix-lib

Getting Started

const Matrix = require('@lorena-ssi/lorena-matrix')
// Creating class Matrix with parameter `homeserver`
const matrix = new Matrix('https://matrix.org')
// Check if user exists
if ( (await matrix.available(username)) ) {
    // Registering to matrix `homeserver` with `username` and `password`
    const primaryUser = await matrix.register('username', 'password')
    // Connecting to account with username `username` and password `password`
    matrix.connect(username, password)
        .then((res)=>{console.log("Connected:", res)})
        .catch((e)=>{console.log("Error:", e)})
    // Read events: If argument=='' then all history events are received
    matrix.events('')
        .then((a,b)=>{console.log("Correct:", a)})
        .catch((e)=>{console.log("Error in events:", e)})
}
1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago