A typed TypeScript wrapper for the AniList GraphQL API and the MyAnimeList REST API. One class exposes two isolated provider namespaces. Every operation with inputs takes a single typed params object plus an optional trailing options object. The parameterless reads, mal.user.me(options?) and mal.anime.suggestions(options?), take the options object alone. Normalized errors, retries, pacing, and caching work identically on both.
npm install anilink-api-wrapperRequires Node.js 22 or later. The package is ESM-only, so use import syntax, not CommonJS require.
import { AniLink } from "anilink-api-wrapper";
// AniList (GraphQL) needs no token for public queries
const aniLink = new AniLink();
const anime = await aniLink.anilist.query.media({ id: 21, type: "ANIME" });
// MyAnimeList (REST) has its own credential slot
const client = new AniLink({ mal: { accessToken: "mal-token" } });
const malAnime = await client.mal.anime.get(
{ id: 21 },
{ fields: ["id", "title", "main_picture"] }
);| Provider | Namespace | Capabilities |
|---|---|---|
| AniList | aniLink.anilist |
Queries, page queries, mutations, pagination helpers, custom(), data helpers, and the crossLink AniList to MAL id mapping |
| MyAnimeList | aniLink.mal |
anime.get, manga.get, and user.me/user.get REST reads with field selection, the anime.search/manga.search keyword searches, the seasonal, anime.ranking/manga.ranking, and suggestions discovery reads, paginated user.animeList/user.mangaList user-list reads, the forum.boards/forum.topics/forum.topic forum reads, plus anime/manga updateMyListStatus and deleteFromList list-status writes |
Both namespaces share one transport layer, which handles timeouts, retries, pacing, circuit breaking, and hooks. Each provider slot has its own credentials and transport settings.
| Docs | Start here |
|---|---|
| Guides | Introduction · Getting started · Provider configuration · Per-request options · Error handling · Retries & resilience · Cancellation & timeouts · Observability · Recipes · TypeScript patterns · Troubleshooting |
| AniList guides | Authentication · Client configuration · Querying · Page queries · Pagination · Mutations · Custom queries · Helpers |
| MAL guides | Authentication · Client configuration · Operations |
| Operation reference | Overview · AniList catalog · MAL catalog |
| API reference (TypeDoc) | AniLink class; the full generated reference is at the docs root |
npm install # install dependencies
npm run check # typecheck, lint, tests, format, JSDoc, api-compare, build
npm run docs:generate # TypeDoc + operation reference + guides site into docs/
npm run docs:dev # serve the guides site locallySee the contributing guide for workflow details.
