
Official client — retries, timeouts, typed responses, webhook verification.
pushStats on ready and every 6 hours.npm install @botnexus/sdk
npm install git+https://github.com/master00J/botnexus.git#main:packages/sdk
Requires Node.js 18+ (native fetch).
import { createBotNexusClient } from '@botnexus/sdk';
const client = createBotNexusClient({
botId: process.env.BOTNEXUS_BOT_ID!,
token: process.env.BOTNEXUS_API_TOKEN!,
baseUrl: 'https://www.rsdash.net',
});
await client.pushStats({ platform: 'discord', server_count: 150 });
const { voted } = await client.checkVote({ platform: 'discord', userId: '80351110224678912' });const client = createBotNexusClient({
botId: '…',
token: '…',
timeoutMs: 10_000,
maxRetries: 3,
onResponse: ({ status, durationMs }) => console.log(status, durationMs),
});Verify inbound BotNexus webhooks on your server:
import { BotNexusWebhook } from '@botnexus/sdk';
const valid = BotNexusWebhook.verify({
secret: process.env.WEBHOOK_SECRET!,
rawBody: req.rawBody,
timestamp: req.headers['x-botnexus-timestamp'],
signature: req.headers['x-botnexus-signature'],
});