Nile PayNile Pay

Installation

Install and configure the Nile Pay SDK

Requirements

  • Node.js 18 or higher
  • Server-side only (not for browsers)

The SDK handles authentication, HMAC signatures, and request signing automatically. Keep your apiKey and apiSecret secure on the server.

Install the SDK

pnpm add @nilepay/sdk
npm install @nilepay/sdk
yarn add @nilepay/sdk
bun add @nilepay/sdk

Initialize the Client

import { createNilePay } from "@nilepay/sdk";

const nilePay = createNilePay({
  environment: "sandbox",
  apiKey: "npk_sandbox_...",
  apiSecret: "nps_sandbox_...",
});

Get Your API Credentials

API credentials are obtained from the merchant dashboard after completing onboarding. You'll receive:

  • apiKey: public key for identifying your account
  • apiSecret: private key for HMAC signature generation

Environments

EnvironmentUse Case
sandboxTesting without real money
liveProduction payments

Switch to live when you're ready to accept real payments.

On this page