> ## Documentation Index
> Fetch the complete documentation index at: https://docs.riseworks.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Environments

> Environment configurations for Rise B2B API staging and production

# Environments

Rise B2B API provides two environments for your integration needs: **staging** for testing and **production** for live operations.

<CardGroup cols={2}>
  <Card title="Staging Environment" icon="flask">
    Use for testing and development
  </Card>

  <Card title="Production Environment" icon="rocket">
    Use for live operations
  </Card>
</CardGroup>

## SDK Environment Configuration

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.

### Environment Field Options

```javascript theme={null}
const { RiseApiClient } = require('@riseworks/riseworks-sdk');

// Production (default) - no environment field needed
const 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
  }
});
```

### Environment Field Values

| Value              | API Base URL                                    | Use Case                |
| ------------------ | ----------------------------------------------- | ----------------------- |
| `'prod'` (default) | `https://integrations-api.riseworks.io`         | Live operations         |
| `'stg'`            | `https://integrations-api.staging-riseworks.io` | Testing and development |
| `undefined`        | `https://integrations-api.riseworks.io`         | Same as 'prod'          |

### Changing Environment at Runtime

You can also change the environment after creating the client:

```javascript theme={null}
const client = new RiseApiClient({
  environment: 'stg',  // Start with staging
  riseIdAuth: {
    riseId: process.env.RISE_ID,
    privateKey: process.env.WALLET_PRIVATE_KEY
  }
});

// Later, switch to production
client.updateEnvironment('prod');

// Check current environment
console.log('Current environment:', client.getEnvironment()); // 'prod'
```

<Warning>
  **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.
</Warning>

<Note>
  B2B API access is enabled per environment. Being enabled in staging does not enable you in production, so request each one you need. See [Getting API Access](/authentication/api-access#enable-your-company-for-b2b-api-access).
</Note>

## Support

<CardGroup cols={2}>
  <Card title="Error Handling" icon="triangle-exclamation" href="/guides/error-handling">
    Troubleshooting environment issues
  </Card>

  <Card title="Support Email" icon="envelope" href="mailto:Hello@Riseworks.io">
    Get help with environment setup
  </Card>
</CardGroup>

<Note>
  **Need help with environment setup?** Contact our support team if you have questions about configuring your integration for staging or production environments.
</Note>
