1.0.2 • Published 1 year ago
@chrissung/the-one-sdk-node v1.0.2
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 moviesasync getMovies(options: DomainQueryOptions): Promise<Movie[]>
Get a single movieasync getMovie(id: string): Promise<Movie>
Get a list of quotes from a moviegetMovieQuotes(id: string, options: DomainQueryOptions): Promise<Quote[]>
Quotes
Get a list of quotesasync getQuotes(options: DomainQueryOptions): Promise<Quote[]>
Get a single quoteasync getQuote(id: string): Promise<Quote>
Books
coming soon!
Characters
coming soon!
Chapters
coming soon!