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

# Environments

> Configure connectors differently for staging and production.

Environments let you maintain separate resource configurations for different stages. Use a staging database for testing and production credentials when you deploy.

## Creating environments

1. Go to **Settings > Environments**
2. Click **Add Environment**
3. Enter a name (e.g., "staging")
4. Click **Create**

Every organization has a **default** environment that represents production. This environment cannot be deleted or renamed.

## Configuring connectors per environment

When you edit a resource, you can configure each environment independently:

1. Go to **Organization Settings > Connectors**
2. Click on a connector to edit it
3. Select the desired environment
4. Enter the connection details for that environment
5. Click **Save**

### Example

| Environment | Host                | Database       |
| ----------- | ------------------- | -------------- |
| default     | prod.example.com    | myapp\_prod    |
| staging     | staging.example.com | myapp\_staging |

<Tip>
  If an environment has no specific configuration, it falls back to the default environment's settings.
</Tip>

## Default Build Environment

Organizations can designate a separate "default build environment" that the AI coder uses by default, distinct from the production environment. This is useful for testing and development workflows where you want the AI to work against staging data.

### Setting a default build environment

1. Go to **Settings > Environments**
2. In the environment list, select the **Set as default build** option next to your chosen environment
3. The environment will be marked with a "Default" badge

The AI coder will use this environment for resource invocations and development contexts unless you explicitly switch environments in the editor.

<Note>
  Production deployments always use the default (production) environment, regardless of the default build environment setting.
</Note>

## Selecting environments in the web editor

The web editor includes an environment selector in the **bottom right** of the screen. Click it to switch between available environments.

When you switch environments:

* The app reloads with the new resource configuration
* API calls use the selected environment's credentials
* Preview reflects the environment-specific data

<Note>
  Production deployments always use the default environment.
</Note>
