Wrapper for the Sokkuri API.
Install all dependencies:
npm install
Build:
npm run build
import { ApiConfig } from "@sokkuri/api";
ApiConfig.init({
// Required
baseUrl: "/api/",
onAuthenticate: () => { return Promise.resolve("access_token"); },
// Optional
onError: (statusCode: number) => { ... }
});
Import the context that you need and use it like this, for example:
import { AnimeDataContext } from "@sokkuri/api";
let context = new AnimeDataContext();
context.getAnime("ID").then(x => console.log(x));