Installation

Install the SDK and create a client.

npm install @kyshi/mor-sdk
npm install @kyshi/mor-sdk@beta

Requires Node.js 18 or newer — the SDK uses the global fetch. It ships ESM, CommonJS and TypeScript declarations, so both import and require work.

Create A Client

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

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

The SDK sends your key as the x-api-key header on every request.

Environment Variables

KYSHI_SECRET_KEY=sk_test_xxxxxxxxxxxxxxxxxxxxx
KYSHI_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxx

Keep secret keys on your server. Never ship one to a browser or mobile app, and never commit one — your frontend should call your backend, and your backend should call Kyshi.

Mode comes from the key, not from environment. A sk_live_ key moves real money whatever else you configure. See Test Mode And Sandbox.

Verify Your Setup

const rates = await kyshi.rates.get({ currency: 'NGN' });
console.log(rates);

A read-only call that confirms the key works before you try to move anything.

Next


Did this page help you?