The One SDK for Node.js
This SDK allows one to connect to the The One API to get lists of movies, books, characters, quotes, and more.
How to install
npm install @chrissung/the-one-sdk-node
How to Use
const { Client } = require("@chrissung/the-one-sdk-node");
const client = new Client({
accessToken: "<your-access-token-here",
});
async function run() {
// Get a list of movies
const movies = await client.getMovies({
pagination: {
limit: 5,
},
});
console.log(movies);
}
run().catch(console.log);
Query Options for Lists
DomainQueryOptions {
pagination: {
limit: number;
page: number;
offset: number;
}
sort:
sort: string;
}
}
SDK Methods
Movies
Get a list of movies
async getMovies(options: DomainQueryOptions): Promise<Movie[]>
Get a single movie
async getMovie(id: string): Promise<Movie>
Get a list of quotes from a movie
getMovieQuotes(id: string, options: DomainQueryOptions): Promise<Quote[]>
Quotes
Get a list of quotes
async getQuotes(options: DomainQueryOptions): Promise<Quote[]>
Get a single quote
async getQuote(id: string): Promise<Quote>
Books
coming soon!
Characters
coming soon!
Chapters
coming soon!