The HTTP REST API client for foxochat.js
Install with npm / yarn / pnpm:
npm install @foxochat/rest
yarn add @foxochat/rest
pnpm add @foxochat/rest
import REST from "@foxochat/rest";
import { APIRoutes, RouteUrlsMap } from "@foxochat/api-types";
const rest = new REST({
baseURL: RouteUrlsMap.production.api,
});
rest.token = TOKEN;
try {
await rest.post(APIRoutes.messages(CHANNEL_ID), {
body: {
content: "floof by coof",
},
});
} catch (error) {
console.error(error);
}