> 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
