Skip to main content

Initial Setup

You can easily integrate Reach to your project with our SDK!

It's fast, flexible, and reliable — with zero-runtime.

Installation

Install Reachu's sdk via npm

npm i @reachu/sdk

Initialization

The SdkClient is the root class of the SDK. It is the main entry point of the SDK. It is the only class that you need to instantiate in order to use the SDK. To instantiate SdkClient, you can run the following command:

const sdk = new SdkClient('YOUR_API_KEY', 'https://graph-ql.reachu.io/');

It is recommended that the new SdkClient method is called prior to any other SDK operations. You can then call the getSDK function every time you need to use an SDK operation.

import { SdkClient } from '@reachu/sdk';

let sdk: SdkClient;

export function getSDK(): SdkClient {
if (!sdk) sdk = new SdkClient('YOUR_API_KEY', 'https://graph-ql.reachu.io/');
return sdk;
}
info

If you are working in development and not in production you should use this reference to our GraphQL endpoint instead: https://graph-ql-dev.reachu.io/