Texto.js

Easy to use end-to-end encrypted messaging client

These docs are still being worked on, some parts may be unfinished

Texto.js

Usage

import texto from 'texto';

// Init client
const client = new texto.Client(config);

client.on('ready', () => {
  const devicePubKey = client.devicePubKey;
  console.log(`Logged in as ${devicePubKey}!`);
  console.log('Invite', `obyte-tn:${devicePubKey}@obyte.org/bb-test`);
});

client.on('pairing', msg => {
  if (msg.body.pairing_secret === 'login')
    msg.reply('To log in, please let me know your address (click ... and "Insert my address")');
});

client.on('message', msg => {
  if (msg.body === 'ping') msg.reply('pong');
});

Generate config

import { toWif } from 'texto/utils';
import { randomBytes } from 'crypto';

const config = {
  testnet: true,
  wif: toWif(randomBytes(32), true),
  tempPrivKey: randomBytes(32).toString('base64'),
  prevTempPrivKey: randomBytes(32).toString('base64'),
  name: 'Fabien'
};

Last updated