Installation
Install the official ZSI Pay Node.js SDK and add secure payment functionality to your server-side application.
Requirements
The ZSI Pay SDK is designed for Node.js server-side applications. Make sure you have a Node.js project ready before installing the SDK.
- •A Node.js application
- •npm, Yarn, or pnpm
- •TypeScript or JavaScript
Install the SDK
Install the latest version of the ZSI Pay SDK using your preferred package manager.
npm install zsi-payyarn add zsi-paypnpm add zsi-payImport the SDK
Once installed, import the ZSIPay client into your server-side application.
import { ZSIPay } from "zsi-pay";The SDK can be used with both TypeScript and JavaScript projects.
Verify the installation
You can verify that the package is installed by checking your project dependencies.
{
"dependencies": {
"zsi-pay": "^1.4.1"
}
}You can also verify the installed package from your terminal:
npm list zsi-payConfigure your credentials
ZSI Pay requires API credentials to authenticate requests. Store your credentials in server-side environment variables rather than hard-coding them in your application.
ZSI_PAY_API_KEY=your_api_key
ZSI_PAY_API_SECRET=your_api_secret
ZSI_PAY_WEBHOOK_SECRET=your_webhook_secretNever expose your API Secret or Webhook Secret in browser, frontend, mobile, or other client-side code. These credentials should only be used in a trusted server-side environment.
Initialize ZSI Pay
After installing the SDK and configuring your credentials, initialize the ZSI Pay client.
import { ZSIPay } from "zsi-pay";
const zsiPay = new ZSIPay({
apiKey: process.env.ZSI_PAY_API_KEY!,
apiSecret: process.env.ZSI_PAY_API_SECRET!,
webhookSecret: process.env.ZSI_PAY_WEBHOOK_SECRET!,
});Next steps
Your SDK is now installed and ready to use. Continue with the quickstart guide to create your first ZSI Pay payment.
