> For the complete documentation index, see [llms.txt](https://docs.hyperswitch.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hyperswitch.io/integrations/prism/architecture/environment-settings.md).

# Environment Settings

Your code behaves differently in development, staging, and production. Prism lets you configure environments explicitly so test transactions don't hit live payment processors and production keys don't leak into debug logs.

## Why Environment Control Matters?

Payment integrations have three distinct modes. And typically most processors support Sandbox and Production. The Development environment will matter when there is a need to mock the payment processor request or response, especially if their sandboxes are flaky for your testing pipeline.

| Environment         | Use Case                                                                                                                                                                                                  |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Production**      | Use this to process live customer transactions. Developers monitor real payment flows, handle actual disputes, and optimize conversion based on production data.                                          |
| **Sandbox/Staging** | Use this to validate end-to-end integrations with real payment processors. Developers verify webhook handling, test edge cases with simulated failures, and ensure the full flow works before going live. |
| **Development**     | You may use this to test features locally without network calls. Developers run unit tests against mock responses and iterate on business logic without waiting for external APIs.                        |

## How to Configure Environment?

You may configure environments at the client level using the SdkOptions as shown below.

```javascript
const { PaymentClient } = require('hyperswitch-prism');

// Sandbox environment configuration
const sandboxConfig = {
    options: { environment: "SANDBOX" },
    connectorConfig: {
        stripe: {
            apiKey: { value: process.env.STRIPE_TEST_API_KEY }
        }
    }
};
const sandboxClient = new PaymentClient(sandboxConfig);

// Production environment configuration
const prodConfig = {
    options: { environment: "PRODUCTION" },
    connectorConfig: {
        stripe: {
            apiKey: { value: process.env.STRIPE_LIVE_API_KEY }
        }
    }
};
const prodClient = new PaymentClient(prodConfig);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.hyperswitch.io/integrations/prism/architecture/environment-settings.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
