1.2.4 • Published 1 year ago

bp_xtrtil v1.2.4

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

bp_xtrtil

bp_xtrtil is an NPM package that provides end-to-end encrypted (e2ee) secure communication between web services, built on top of the Matrix protocol. This package makes it easy to send and receive encrypted messages, create and manage rooms, and invite users to rooms.

Installation

To install the package, run the following command:

npm install bp_xtrtil

Usage

  1. Import the package:
const bp_xtrtil = require("bp_xtrtil");marvk
  1. Provide the user's login credentials (homeserver URL, username and password):
const loginCred = {
homeserverUrl: "https://matrix.org",
username: "your-username",
password: "your-password",
};

or in json file like this conf.json:

{
"homeserverUrl": "https://matrix.org",
"username": "yourUsername",
"password": "yourPassword"
}
  1. Start the client with the provided credentials using object or file path to file with creds:
bp_xtrtil.runClient(filePath, loginCred)
.then(() => {
// Your code here
})
.catch((error) => {
console.error("Error while running client:", error);
});
  1. Use the available functions to perform various tasks, such as sending encrypted messages, listening for encrypted messages, inviting users to a room, and more. See the following examples:
const roomsID = await bp_xtrtil.getJoinedRoomsID();
const roomId = roomsID[0];

const mess = {
albumId: 1,
id: 2,
title: "reprehenderit est deserunt velit ipsam",
url: "https://via.placeholder.com/600/771796",
thumbnailUrl: "https://via.placeholder.com/150/771796",
};

// Send an encrypted message
bp_xtrtil.sendEncryptedMessage(roomId, mess)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error("Error while sending encrypted message:", error);
});

// Listen for encrypted messages
bp_xtrtil.messageListenerEncrypted(
(message) => {console.log("Received message:", message);},
roomId
);

Documentation

For a detailed description of the available functions and their usage, refer to the package's source code comments.

Contributing

Contributions to the package are welcome. Feel free to open an issue or submit a pull request on the repository.

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago