Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ResoNet-Lib

ResoNet-Lib is a Node.js library that provides an easy way to interface with the Resonite Api and its SignalR endpoints.

How to setup

  • Install the library by running npm install github:Reso-Net/ResoNet-Lib
  • Create a new instance of ResoNetLib and supply a custom config that follows the config scheme below
  • Call client.start() to login and start SignalR
  • Call what ever functions you may need for example const user = await client.fetchUser("U-LeCloutPanda");

Example Config

{
	"username": "",
	"password": "",
	"totp": "" 
}

TOTP is only needed if you use TOTP on the account

Example Class

const ResoNetLib = require('resonet-lib');
const config = require('config.json');

const client = new  ResoNetLib(config);

async function  setup() {
	await client.start();
	const contacts = await  client.fetchContacts();
	contacts.forEach(contact  => {
    		client.log(`Username ${contact.contactUsername}, Contact Status ${contact.contactStatus}, Is Accepted: ${contact.isAccepted}`);
	})
}
setup();

More examples can be found in the examples folder.

About

Node.js library that interacts with the Resonite API and its SignalR endpoints

Topics

Resources

Stars

Watchers

Forks

Used by

Contributors

Languages