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

# Custom Domain

***

## Custom Agent Configuration for US Domain or VPC

This section guides users operating Encord with the US domain (`https://api.us.encord.com`) or within their private Virtual Private Cloud (VPC) on how to configure their Custom Agents.

***

### STEP 1: Set the `ENCORD_DOMAIN` Environment Variable

Define the **Encord API domain**, not the front-end application domain.

* **Running Locally:**
  ```shell theme={"dark"}
  export ENCORD_DOMAIN=https://api.us.encord.com
  ```
* **Deploying with a GCP Cloud Function:** Create a GCP secret and pass in the domain:
  ```shell theme={"dark"}
  --set-secrets="ENCORD_SSH_KEY=YOUR_GCP_STORED_KEY:latest,ENCORD_DOMAIN=YOUR_GCP_STORED_DOMAIN"
  ```

***

### STEP 2: Set the `ENCORD_SSH_KEY` or `ENCORD_SSH_KEY_FILE` Environment Variables

Provide your access key for authentication.

* **Running Locally:**
  ```shell theme={"dark"}
  export ENCORD_SSH_KEY_FILE="path/to/your/key"
  ```
  or
  ```shell theme={"dark"}
  export ENCORD_SSH_KEY="<your key>"
  ```
* **Deploying with a GCP Cloud Function:** Create a GCP secret and pass in the key:
  ```shell theme={"dark"}
  --set-secrets="ENCORD_SSH_KEY=YOUR_GCP_STORED_KEY:latest,ENCORD_DOMAIN=YOUR_GCP_STORED_DOMAIN"
  ```

***

### STEP 3: Pass the Front-end Domain to the Custom Agent Declaration

Pass the **Encord front-end domain** into the `@editor_agent` declaration to ensure the function respects Cross-Origin Resource Sharing (CORS):

```python theme={"dark"}
@editor_agent(custom_cors_regex="https://app.us.encord.com") # Or the domain of your custom FE
```
