disboard-js
v0.0.3
Published
Transparent TypeScript SDK for Mastodon, Misskey, and more.
Readme
disboard-js
disboard.js - Transparent TypeScript SDK for Mastodon, Misskey, and more.
Installation
$ pnpm add disboard-js @disboard-js/adapter-mastodonUsage
import { createClient } from "disboard-js";
import { MastodonAdapter } from "@disboard-js/adapter-mastodon";
// if credential are not set in application, you can also pass them as options
const client = createClient({
baseUrl: "https://mastodon.social",
adapter: new MastodonAdapter(),
});
// if credential are already set in application
const client = createClient({
baseUrl: "https://mastodon.social",
adapter: new MastodonAdapter({
accessToken: MASTODON_ACCESS_TOKEN,
refreshToken: MASTODON_REFRESH_TOKEN,
}),
});
// get account information (unified)
const me = await client.accounts.me();
console.log(me.displayName);
// get account information (Mastodon-specific)
const me = await client.raw.accounts.verifyCredentials();
console.log(me.displayName);Adapters
| Platform | Server Version | Package | | :------: | :------------: | -------------------------------------------------------------------------------------------- | | Mastodon | 4.3+ | @disboard-js/adapter-mastodon | | Misskey | 2026.3+ | @disboard-js/adapter-misskey | | Pleroma | 2.7+ | @disboard-js/adapter-pleroma | | mixi2 | undefined | @disboard-js/adapter-mixi2 | | Threads | undefined | @disboard-js/adapter-threads |
