web2-mq
v1.2.27
Published
web3-mq-js is the official JavaScript client for House Studio, a service for building chat applications.
Downloads
7
Maintainers
Readme
web3-mq JS
web3-mq-js is the official JavaScript client for House Studio, a service for building chat applications.
Installation
Install with NPM
npm install web3-mq
Install with Yarn
yarn add web3-mq
Usage
create client
import { Web3MQ } from 'web3-mq';
const loginParams = {
login_random_secret: 'YOUR_LOGIN_RANDOM_SECRET',
signature: 'YOUR_SIGNATURE',
wallet_address: 'YOUR_WALLTE_ADDRESS',
appid: 'YOUR_APPID',
};
// create client
const client = Web3MQ.getInstance(loginParams);
// or
const client = Web3MQ.getInstance('YOUR_ACCESS_TOKEN');
create room
const room = client.createRoom();
create message
const message = client.createMessage();
create user
const user = client.createUser();
utils function
import { login, register, getLoginRandomSecret } from 'web3-mq';
const data = await register();
const data = await getLoginRandomSecret();
const data = await login();