Environment Variables
Create a .env file (recommended):
SALIGPAY_CLIENT_ID=your_client_id
SALIGPAY_CLIENT_SECRET=your_client_secret
SALIGPAY_ENV=sandbox
SDK Configuration Options
interface SaligPayConfig {
/** OAuth Client ID */
clientId?: string;
/** OAuth Client Secret */
clientSecret?: string;
/** Admin API Key for platform operations */
adminKey?: string;
/** Custom base URL (overrides env setting) */
baseUrl?: string;
/** Environment: 'production' | 'sandbox' */
env?: "production" | "sandbox";
}
Example Configuration
// Using environment variables (recommended)
const saligpay = new SaligPay({
clientId: process.env.SALIGPAY_CLIENT_ID,
clientSecret: process.env.SALIGPAY_CLIENT_SECRET,
env: process.env.SALIGPAY_ENV as "production" | "sandbox",
});
// Custom base URL for staging/testing
const saligpayStaging = new SaligPay({
clientId: "your-id",
clientSecret: "your-secret",
baseUrl: "https://staging-api.saligpay.com",
});
Last modified on