A simple, lightweight and framework-agnostic JSON:API client using Axios. Version 11.1.0 (stable) supports Node 18+ and modern browsers (Chrome 116+, Firefox 118+, Safari 17.1+). Key differentiators: automatically resolves relationships (flattening `included` into data), works in both Node and browsers, and provides a clean Promise-based API. Compared to other JSON:API clients like `jsonapi-client` or `jsonapi-datastore`, Kitsu focuses on simplicity and zero-config usage for the Kitsu.app API (anime/manga) but works with any JSON:API-compliant server. Ships TypeScript definitions. Released under MIT license.
npm install kitsuNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows instantiation with default and custom baseURL, then CRUD operations (get, create, update, remove) with common JSON:API parameters like filtering, sorting, and pagination.
Upgrade to Node 18+. Use `import Kitsu from 'kitsu'` instead of `require('kitsu')`. If you must use CommonJS, use dynamic import: `const { default: Kitsu } = await import('kitsu')`.Access data via `response.data` (or use destructuring: `const { data } = await api.get(...)`) instead of using the response directly as the data object.Replace `api.fetch('resource')` with `api.get('resource')`.Always include `id` in the data object: `api.update('posts', { id: '1', title: 'Updated' })`. Do not pass id as a second argument.Ensure your baseURL does not end with a `/`. For example, use `'https://api.example.com/v2'` instead of `'https://api.example.com/v2/'`.
Upgrade to Node 18+. Use `import Kitsu from 'kitsu'` if possible. For CommonJS workaround: `const { default: Kitsu } = require('kitsu')`.Run `npm install kitsu` or `yarn add kitsu`. Ensure tsconfig.json has `"moduleResolution": "node"` (or `node16`/`bundler`) and `"esModuleInterop": true`.
Verify the baseURL. For kitsu.app API, use default (no baseURL). For custom servers, ensure the URL is correct and includes the version if needed. Check that the resource type is pluralized correctly (e.g., 'anime' not 'animes').
Ensure you are awaiting the request: `const response = await api.get('anime')`. If using .then(), chain correctly: `api.get('anime').then(response => console.log(response.data))`.