@foxochatjs/rest
v0.1.16
Published
The HTTP REST API client for foxochat.js
Downloads
17
Readme
FoxoChat REST
The HTTP REST API client for foxochat.js
Installation
Install with npm / yarn / pnpm:
npm install @foxochatjs/rest
yarn add @foxochatjs/rest
pnpm add @foxochatjs/restUsage
import REST from "@foxochatjs/rest";
import { APIRoutes, RouteUrlsMap } from "@foxochatjs/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);
}