unofficial-wanikani
v0.0.8
Published
An unofficial JavaScript client for the WaniKani API.
Downloads
92
Maintainers
Readme
The (Unofficial) WaniKani Client
This package provides a client for interacting with the WaniKani API.
Installation
npm install unofficial-wanikani
Usage
import WaniKani, { fetchAssignments } from "unofficial-wanikani";
const apiKey = "your_wanikani_api_key";
// using a client instance
const wk = WaniKani(apiKey);
const assignments = await wk.fetchAssignments({
params: { immediately_available_for_review: true },
});
const subjectsAvailableForReview = await wk.fetchSubjects({
params: {
ids: assignments.data.map((assign) => assign.data.subject_id).join(","),
},
});
// using bare function
const assignments = await fetchAssignments(apiKey, {
params: { immediately_available_for_review: true },
});