@alexortizrosado/lord-of-the-rings-sdk
v2022.0.8
Published
Typescript SDK for the The Lord of the Rings API - The One API that rules them all
Downloads
10
Readme
Typescript SDK for The Lord of the Rings API
Access Token
Before using the SDK, you'll need to get an access token from https://the-one-api.dev/sign-up
Installation
npm i @alexortizrosado/lord-of-the-rings-sdk
Usage
To get a catalog of books:
import { LotrApi } from "@alexortizrosado/lord-of-the-rings-sdk";
const client = new LotrApi("your-access-token");
const books = await client.Book.catalog({
limit: 3,
});
To get a list of quotes from a character:
import { LotrApi } from "@alexortizrosado/lord-of-the-rings-sdk";
const client = new LotrApi("your-access-token");
const books = await client.Quote.getQuotesByCharacter(
"5cf5805fb53e011a64671582",
{
limit: 5,
}
);