blacket-sdk

blacket-sdk

An API wrapper for https://blacket.org/ written in TypeScript, attempting providing 1:1 implementation of the API by v1.0.0

npm install blacket-sdk
import { Client, getToken } from 'blacket-sdk';

const client = new Client({
token: await getToken("zastix", "password"),
// Whether to reconnect to the WebSocket when disconnected
reconnect: true
});

client.on(SocketEvents.OPEN, (c) => {
console.log(`Logged in as ${c.user.username} (${c.user.id})`);

const room = c.roomManager.getOrCreateRoom(0, "global");

await room.send("Hello, world!");
});

The documentation can be found here, we are actively working to improve our documentation!