1.0.2 • Published 1 year ago

liblab-kolberszymon v1.0.2

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

The One API SDK

The One API SDK is a simple TypeScript library that provides an interface to interact with The One API. The SDK currently supports the /movie, /movie/{id}, and /movie/{id}/quote endpoints.

Table of Contents

Requirements

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/the-one-api-sdk.git
  1. Navigate to the project directory and install the dependencies:
cd the-one-api-sdk
yarn

Usage

  1. Import the TheOneAPISDK class:
import { TheOneAPISDK } from "./the-one-api-sdk";
  1. Initialize the SDK with your API key:
const apiKey = "your-api-key-here";
const sdk = new TheOneAPISDK();
await sdk.init(apiKey);
  1. Use the SDK to make requests to the API:
// Get all movies
const movies = await sdk.getMovies();
console.log(movies);

// Get a specific movie by ID
const movieId = "5cd95395de30eff6ebccde5c"; // Example movie ID
const movie = await sdk.getMovie(movieId);
console.log(movie);

// Get quotes for a specific movie
const quotes = await sdk.getMovieQuotes(movieId);
console.log(quotes);

Testing

To run the tests, use the following command:

yarn test