0.0.2 • Published 1 year ago

danyal-lotrsdk v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

LOTR SDK

A SDK wrapper for The One API

Handles API key and fetch logic, you can get the API key by signing up on the website.

It has 3 methods that can be called after initialization:

SDK Reference

Initialize it by calling the constructor:

import LOTRSDK from "danyal/SDK";
const client = new LOTRSDK();

async function getMovie() {
  const res = await client.getMovieById("1");
  return res;
}
MethodParamsDescription
getMoviesnoneRequired. Your API key
getMovieByIdid: stringRequired. Your API key
getMovieQuotesid: stringRequired. Your API key

e.g. getMovies and getMovieByIdreturns:

  docs: [{
    _id: string;
    academyAwardNominations: number;
    academyAwardWins: number;
    boxOfficeRevenueInMillions: number;
    budgetInMillions: number;
    name: string;
    rottenTomatoesScore: number;
    runtimeInMinutes: number;
  }]
  limit: number;
  offset: number;
  page: number;

Running example

  • Clone this repo
  • npm install
  • Provide your API_KEY in .env
  • npm run example
0.0.2

1 year ago

0.0.1

1 year ago