The Rise SDK uses the environment field to determine which API endpoints to use. By default, it uses production, but you can change it to staging for testing.
const { RiseApiClient } = require('@riseworks/sdk');// Production (default) - no environment field neededconst prodClient = new RiseApiClient({ riseIdAuth: { riseId: process.env.RISE_ID, privateKey: process.env.WALLET_PRIVATE_KEY }});// Staging - explicitly set environment to 'stg'const stagingClient = new RiseApiClient({ environment: 'stg', // This changes the API base URL to staging riseIdAuth: { riseId: process.env.RISE_ID, privateKey: process.env.WALLET_PRIVATE_KEY }});
You can also change the environment after creating the client:
Copy
Ask AI
const client = new RiseApiClient({ environment: 'stg', // Start with staging riseIdAuth: { riseId: process.env.RISE_ID, privateKey: process.env.WALLET_PRIVATE_KEY }});// Later, switch to productionclient.updateEnvironment('prod');// Check current environmentconsole.log('Current environment:', client.getEnvironment()); // 'prod'
Important: Never use production credentials in staging environment, and never use staging credentials in production. Each environment has separate data and should be treated independently.
Need help with environment setup? Contact our support team if you have questions about configuring your integration for staging or production environments.