Installation

Install the SDK from npm:

npm install @kyshi/mor-sdk

For the beta release:

npm install @kyshi/mor-sdk@beta

Requirements

The SDK requires Node.js 18 or newer.

Initialize The SDK

Create the SDK client with your Kyshi secret key.

import { Kyshi } from '@kyshi/mor-sdk';

const kyshi = new Kyshi({
  secretKey: process.env.KYSHI_SECRET_KEY!,
  environment: 'test',
});

The SDK sends your key to Kyshi as the x-api-key header.

Environment Variables

Use environment variables for secrets:

KYSHI_SECRET_KEY=sk_test_xxxxxxxxxxxxxxxxxxxxx
KYSHI_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxx

KYSHI_SECRET_KEY is used for API requests. KYSHI_WEBHOOK_SECRET is used only to verify inbound webhook signatures.

Test And Live Mode

Use test keys while building. Switch to a live key only after your integration has been tested end to end.

const kyshi = new Kyshi({
  secretKey: process.env.KYSHI_SECRET_KEY!,
  environment: 'live',
});

Keep secret keys on your server. Your frontend should call your backend, and your backend should call Kyshi.