### Install node-shikimori using npm Source: https://github.com/capster/node-shikimori/blob/master/README.md Instructions to install the node-shikimori library using npm. This is a zero-dependency library for accessing the Shikimori API. ```bash npm i --save node-shikimori ``` -------------------------------- ### Install node-shikimori using yarn Source: https://github.com/capster/node-shikimori/blob/master/README.md Instructions to install the node-shikimori library using yarn. This library is designed for TypeScript projects and has no external dependencies. ```bash yarn add node-shikimori ``` -------------------------------- ### Authorization: Get Access Token Source: https://github.com/capster/node-shikimori/blob/master/README.md Shows how to obtain an access token using the authorization code flow. This requires your Shikimori application's client ID and client secret. ```typescript import { auth } from 'node-shikimori'; const { getAccessToken } = auth({ clientId: 'YOUR_CLIENT_ID', clientSecret: 'YOUR_CLIENT_SECRET', }); const accessToken = await getAccessToken('YOUR_AUTH_CODE'); ``` -------------------------------- ### Basic Usage: Initialize Client and Fetch Anime by ID Source: https://github.com/capster/node-shikimori/blob/master/README.md Demonstrates how to initialize the Shikimori client and fetch anime data by its ID. Requires the 'node-shikimori' library. ```typescript import { client } from 'node-shikimori'; const shikimori = client(); const result = await shikimori.animes.byId({ id: 1 }); console.log(result); ``` -------------------------------- ### Authorization: Set Access Token and Fetch User Info Source: https://github.com/capster/node-shikimori/blob/master/README.md Demonstrates how to set the obtained access token on the client and then fetch the current user's information using the 'whoami' endpoint. ```typescript const shikimori = client(); shikimori.setAccessToken(YOUR_ACCESS_TOKEN); const currentUser = await shikimori.users.whoami(); console.log(currentUser) ``` -------------------------------- ### Authorization: Refresh Access Token Source: https://github.com/capster/node-shikimori/blob/master/README.md Illustrates how to refresh an expired access token using a refresh token. Access tokens are valid for 1 day. ```typescript const newAccessToken = await refreshAccessToken('YOUR_REFRESH_TOKEN'); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.