@sokkuri/api
v1.0.1
Published
Wrapper for the Sokkuri API
Readme
API
Wrapper for the Sokkuri API.
Setup & Build
Install all dependencies:
npm installBuild:
npm run buildUsage
Initial configuration:
import { ApiConfig } from "@sokkuri/api";
ApiConfig.init({
// Required
baseUrl: "/api/",
onAuthenticate: () => { return Promise.resolve("access_token"); },
// Optional
onError: (statusCode: number) => { ... }
});Data Contexts
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));