@sokkuri/api
v1.0.1
Published
Wrapper for the Sokkuri API
Downloads
1
Readme
API
Wrapper for the Sokkuri API.
Setup & Build
Install all dependencies:
npm install
Build:
npm run build
Usage
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));