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/sdknpm install @nilepay/sdkyarn add @nilepay/sdkbun add @nilepay/sdkInitialize 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
| Environment | Use Case |
|---|---|
sandbox | Testing without real money |
live | Production payments |
Switch to live when you're ready to accept real payments.