# codemask-lotr-sdk

> Lord Of The Rings API SDK

Latest version **1.0.4** (published 2023-06-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install codemask-lotr-sdk
pnpm add codemask-lotr-sdk
yarn add codemask-lotr-sdk
bun add codemask-lotr-sdk
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2023-06-13 |
| First published | 2023-06-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 13.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Damilola Odeyemi |
| Maintainers | deematt |

## Links

- npm: https://www.npmjs.com/package/codemask-lotr-sdk
- npm.io page: https://npm.io/package/codemask-lotr-sdk

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^1.4.0
- [dotenv](https://npm.io/package/dotenv.md) ^16.1.4
- [isomorphic-unfetch](https://npm.io/package/isomorphic-unfetch.md) ^4.0.2

## Recent versions

- 1.0.4 (latest) — 2023-06-13
- 1.0.3 — 2023-06-13
- 1.0.2 — 2023-06-13
- 1.0.1 — 2023-06-13
- 1.0.0 — 2023-06-13

## README

# SDK for Lord-of-the-Ring API

This SDK provides easy access to the Lord of the Rings API endpoints for movies and quotes.

## Documentation

The official documentation for The Lord-of-the-Ring API can be found [here](https://the-one-api.dev/documentation) 

This SDK library currently supports the Movie and Quote endpoints:

- /movie
- /movie/{id}
- /movie/{id}/quote
- /quote
- /quote/{id}

## Installation

Install the sdk library with npm

```bash

npm install codemask-lotr-sdk
```
## Usage/Examples

To use the SDK, import the `LotrSDK` function and initialize by passing the following configuration parameters:

The following parameters are accepted:

`apiToken` (Required): The API access token.
You must [create an account](https://the-one-api.dev/sign-up) to get a valid token.

`baseURL` (Optional): The Default base URL is https://the-one-api.dev/v2.
It's subject to change from time to time, please check the [main site](https://the-one-api.dev/).


#### Example Usage with javascript/typescript

```javascript
import { LotrSDK } from '@codemask-lotr-sdk';

const sdk = new LotrSDK({
  apiToken: 'YOUR_API_TOKEN'
});


// retrieve all movies
const allMovies = sdk.movies.getAllMovies();

console.log(allMovies);

// retrieve all quotes
const allQuotes = sdk.quotes.getAllQuotes()

console.log(allQuotes);

```

## Available Methods

The SDK provides the following methods for interacting with the LOTR API:

#### Movies API methods

- To retrieve all movies
    
    movie.getAllMovies(queryOptions?: QueryOptions)

- To retrieve a single movie by ID
    
    movie.getMovieById(id: string, queryOptions?: QueryOptions)

- To retrieve movie quotes by the movie ID.
    
    movie.getMovieQuotes(id: string, queryOptions?: QueryOptions)

#### Quotes API methods

- To retrieve all quotes.

    quote.getAllQuotes(queryOptions?: QueryOptions)

- To retrieve a quote by its ID.
    
    quote.getQuoteById(id: string, queryOptions?: QueryOptions)


## Running Tests

To run tests, run the following command

```bash
  npm run test
```

---
_Source: https://npm.io/package/codemask-lotr-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
