Two small libraries wrap the API: nunu-sdk for JavaScript (Node.js 18+) and nunu-py for Python 3.9+. Both have no dependencies. TODO(Sam): they are ready in the repository but not yet published to npm and PyPI; until then, copy the single file from the source.
JavaScript
const { NunuList, verifySignature } = require('nunu-sdk');
const nunu = new NunuList({ key: process.env.NUNU_KEY });
const server = await nunu.getServer('112233445566778899');
await nunu.postStats('987654321098765432', { serverCount: client.guilds.cache.size });
const { voted } = await nunu.hasVoted('987654321098765432', userId, { type: 'bot' });
// in your webhook route, with the raw body:
if (!verifySignature(rawBody, req.get('X-Nunu-Signature'), process.env.NUNU_WEBHOOK_SECRET)) return res.sendStatus(401);
Python
from nunu import NunuList, verify_signature
nunu = NunuList(key=os.environ["NUNU_KEY"])
server = nunu.get_server("112233445566778899")
nunu.post_stats("987654321098765432", server_count=len(bot.guilds))
voted = nunu.has_voted("987654321098765432", user_id, type="bot")["voted"]
ok = verify_signature(raw_body, request.headers.get("X-Nunu-Signature"), os.environ["NUNU_WEBHOOK_SECRET"])
Errors from the API raise NunuError with status, code and message; on 429 it also has retry_after.