Installation

Install the package with:

npm install @rye-api/rye-sdk
# or
yarn add @rye-api/rye-sdk
# or
pnpm add @rye-api/rye-sdk

Client initialization

The client needs to be created with your account’s API authorization header and the IP address of your end shopper.

Headers can be found in the Rye Console, although note that the value provided for “Shopper IP” represents your IP address. For production use cases, you should use the end shopper’s IP address rather than a hardcoded constant.

The client will automatically make requests to the correct environment based on your authHeader.

import { RyeClient, ENVIRONMENT } from "@rye-api/rye-sdk";

const ryeClient = new RyeClient({
  authHeader: "<AUTH_HEADER>",
  shopperIp: "<SHOPPER_IP>",
});

Resources