The official JavaScript/TypeScript client library for the Revolt chat API (revolt-api). Current version 0.12.0 provides fully typed API request builder and TypeScript typings for all API objects. Ships with ESM and CommonJS support, includes built-in TypeScript declarations. Key differentiator: auto-generated from OpenAPI spec via @insertish/oapi, ensuring type safety for all endpoints and parameters. Developed by the Revolt team, follows semantic versioning.
npm install stoat-apiVerified import paths — ran on the pinned version, not inferred.
Shows initialization with optional authentication, fetching current user, and posting a message with full TypeScript types.
Use const { API } = require('revolt-api') instead of const API = require('revolt-api')Pass { authentication: { revolt: 'your-token' } } to the API constructorclient.delete('/channels/some-id') works fine without a second argumentUse complementary packages like revolt.js for full bot development
Install the package: npm install revolt-api
Ensure correct import: import { API } from 'revolt-api'Import type { User } from 'revolt-api' and use it explicitly: const user: User = await client.get('/users/@me')Check that REVOLT_TOKEN is set correctly and the API URL is reachable