npm

unofficial-wanikani
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

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 },
});

Projects Using unofficial-wanikani

Package Sidebar

Install

npm i unofficial-wanikani

Weekly Downloads

7

Version

0.0.8

License

MIT

Unpacked Size

49 kB

Total Files

14

Last publish

Collaborators

  • patrickeddy