Gratero SDK

Gratero SDK

Currently SDK is only available for Node JS.

The Gratero SDK offers a convenient solution to access Gratero APIs from a server-side applications.

Why use Server SDK?

Using the Gratero SDK offers several advantages:

  1. Simplified Integration: The SDK abstracts the complexities of making API requests, allowing you to focus on your application logic.
  2. Consistent Interface: The SDK provides a consistent interface for interacting with the Gratero API, reducing the likelihood of errors.
  3. Built-in Authentication: The SDK handles authentication for you, ensuring that your API requests are secure.
  4. Time-saving: With the SDK, you can quickly and easily implement Gratero's features without writing repetitive boilerplate code.

Getting Started

Install the SDK

To install the Gratero SDK, run the following command:

Terminal
npm i gratero

Create a Instance

After installing the SDK, you can create an instance of the Gratero client. This instance will be used to make API requests.

index.js
import { Instance } from "gratero";
 
const gratero = new Instance({
  api_key: "YOUR_API_KEY",
  secret_key: "YOUR_SECRET_KEY",
  environment: 'test' | 'live'      // Default to test
});

Replace YOUR_API_KEY and YOUR_SECRET_KEY with the API key and Secret key you obtained from the Gratero website.