Typescript typings and OpenAPI v3 generator for the Stoat API.
  • TypeScript 98%
  • JavaScript 2%
Find a file
2026-03-23 19:31:39 +00:00
.github/workflows ci: fix permissions to allow provenance generation 2025-10-16 18:33:48 +01:00
.vscode Add OpenAPI generators, automation, and user routes. 2021-07-11 16:02:15 +01:00
src chore: build library from latest spec [skip ci] 2026-03-23 19:31:39 +00:00
.gitignore chore: switch to ESM-only & drop Axios dependency 2025-04-04 15:15:24 +01:00
cli.js chore: use bigint parse/stringify 2025-10-22 17:47:18 +01:00
default.nix fix: handle empty responses (on 204) 2025-08-29 15:24:32 +02:00
LICENSE chore: revolt-api -> stoat-api 2025-10-16 18:21:09 +01:00
OpenAPI.json chore: generate OpenAPI specification 2026-03-23 19:31:19 +00:00
package.json chore: bump version to 0.11.5 [skip ci] 2026-02-18 10:13:23 +00:00
pnpm-lock.yaml chore: use bigint parse/stringify 2025-10-22 17:47:18 +01:00
README.md feat: switch to @insertish/oapi and cjs 2022-03-20 13:02:10 +00:00
tsconfig.json chore: use bigint parse/stringify 2025-10-22 17:47:18 +01:00

Revolt API

revolt-api

This package contains typings for objects in the Revolt API and a fully typed API request builder.

Example Usage

If you just need access to types:

import type { User } from 'revolt-api';

If you want to send requests:

import { API } from 'revolt-api';

// Initialise a new API client:
const client = new API();

// or with authentication:
const client = new API({ authentication: { revolt: 'bot-token' } });

// Make requests with ease:
client.get('/users/@me')
    // Fully typed responses!
    .then(user => user.username);

// No need to worry about the details:
let channel_id = "some channel id";
client.post(`/channels/${channel_id}/messages`, {
    // Parameters given are fully typed as well!
    content: "some content"
});

For more details on how this works, see the README of @insertish/oapi.