1.0.14 • Published 11 months ago

ring-sdk v1.0.14

Weekly downloads
-
License
BSD-3-Clause
Repository
-
Last release
11 months ago

Ring SDK

The Ring SDK is a Typescript library that provides a convenient interface for interacting with the Ring API. It allows you to fetch movie and quote data from the API and perform various operations.

Installation

To use the Ring SDK in your project, you can install it via npm:

npm install ring-sdk

Test

To run the tests

npm run test

Usage

Here's an example of how to use the Ring SDK in your JavaScript/TypeScript code:

import { RingSDK } from "ring-sdk";

// Create an instance of the SDK
const client = new RingSDK("https://api.example.com", {
  headers: {
    Authorization: "Bearer your_token",
  },
});

// Example usage with async/await
(async () => {
  try {
    const movies = await client.movies.getAllMovies();
    console.log("Movies:", movies);
  } catch (error) {
    console.error("Error:", error);
  }

  try {
    const quotes = await client.quotes.getAllQuotes();
    console.log("Quotes:", quotes);
  } catch (error) {
    console.error("Error:", error);
  }
})();

// Example usage using promises
client.movies
  .getAllMovies()
  .then((movies) => {
    console.log("Movies:", movies);
  })
  .catch((error) => {
    console.error("Error:", error);
  });

client.quotes
  .getAllQuotes()
  .then((quotes) => {
    console.log("Quotes:", quotes);
  })
  .catch((error) => {
    console.error("Error:", error);
  });

API Reference

The Ring SDK provides the following classes and methods:

  • RingSDK: The main class representing the SDK. It has movies and quotes properties to access the movie and quote APIs.

  • MoviesAPI: A class representing the movie API. It provides methods like getMovieById and getAllMovies to fetch movie data.

  • QuotesAPI: A class representing the quote API. It provides methods like getQuoteById and getAllQuotes to fetch quote data.

For detailed information about the classes and methods, please refer to the source code and documentation.

Contributing

Contributions to the Ring SDK are welcome! If you find any issues or have ideas for improvements, feel free to open an issue or submit a pull request on the GitHub repository.

License

The Ring SDK is open-source and released under the MIT License.

1.0.14

11 months ago

1.0.13

11 months ago

1.0.12

11 months ago

1.0.11

11 months ago

1.0.10

11 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago