1.0.2 • Published 11 months ago
@hzein/lotr-sdk v1.0.2
lotr-sdk
The lotr-sdk is a simple SDK that provides functionalities for easy access to "https://the-one-api.dev/v2"
Getting started
Installation
npm i @hzein/lotr-sdk
Access Token
To access the API endpoints, go to "https://the-one-api.dev/sign-up" and sign up to acquire access token.
Import
import LotR from "@hzein/lotr-sdk";
Example
const lordOfTheRings= new LotR({
apiKey:'your-access-token-acquired-after-signup',
baseUrl: 'Optional-incase-baseUrl-has-changed'
});
lordOfTheRings.getMovies().then((movies) => {
console.log(movies);
});
Methods
getMovies()
getMovieById(movieId)
getQuotesFromMovieById(movieId)
getQuotes()
getQuoteById(quoteId)
Note: These methods are async and return a promise.
Debug
-Error: Cannot find module. If this error occurs, please add "type": "module" into your package.json