Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions content/Get-Started/app-configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,30 @@ If you don't set provider API keys, LLM requests are routed through the Agentuit
Environment variables prefixed with `AGENTUITY_PUBLIC_`, `VITE_`, or `PUBLIC_` are exposed to the frontend bundle and visible in the browser. Never put secrets or API keys in these variables.
</Callout>

### Platform-Injected Environment Variables

When your project is deployed to Agentuity Cloud, the platform automatically injects the following environment variables into your runtime. You do not need to set these yourself.

| Variable | Description |
|----------|-------------|
| `AGENTUITY_CLOUD_BASE_URL` | The base URL of your deployment (e.g., `https://dep-abc123.agentuity.cloud`). Used internally for authentication callbacks and as the canonical URL for the running deployment. |
| `AGENTUITY_CLOUD_DOMAINS` | Comma-separated list of all domains associated with the deployment, including the deployment URL, project URL, any custom domains (CNAMEs), and PR preview URLs. |
| `AGENTUITY_CLOUD_ORG_ID` | Your organization ID. |
| `AGENTUITY_CLOUD_PROJECT_ID` | Your project ID. |
| `AGENTUITY_CLOUD_DEPLOYMENT_ID` | The current deployment ID. |

```typescript
// Access the deployed URL
const baseUrl = process.env.AGENTUITY_CLOUD_BASE_URL;

// Access all associated domains
const domains = process.env.AGENTUITY_CLOUD_DOMAINS?.split(',');
```

<Callout type="info" title="Automatic CORS & Auth">
`AGENTUITY_CLOUD_BASE_URL` and `AGENTUITY_CLOUD_DOMAINS` are automatically used by the runtime for CORS origin validation and by `@agentuity/auth` for trusted origins. You typically don't need to reference them directly unless you have custom domain logic.
</Callout>

## Infrastructure as Code

Unlike traditional platforms, Agentuity defines infrastructure in your route files:
Expand Down
24 changes: 24 additions & 0 deletions content/Reference/CLI/deployment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,30 @@ agentuity deploy

Both URLs are automatically provisioned with HTTPS. The project URL always routes to the active deployment.

### Deployment Environment Variables

When deployed, the platform automatically injects environment variables so your agents can discover their own URLs at runtime:

| Variable | Description |
|----------|-------------|
| `AGENTUITY_CLOUD_BASE_URL` | The base URL of the current deployment (e.g., `https://dep-abc123.agentuity.cloud`). |
| `AGENTUITY_CLOUD_DOMAINS` | Comma-separated list of all domains for the deployment — deployment URL, project URL, custom domains (CNAMEs), and PR preview URLs. |
| `AGENTUITY_CLOUD_DEPLOYMENT_ID` | The current deployment ID. |
| `AGENTUITY_CLOUD_PROJECT_ID` | The project ID. |
| `AGENTUITY_CLOUD_ORG_ID` | The organization ID. |

```typescript
// Get the canonical URL for this deployment
const myUrl = process.env.AGENTUITY_CLOUD_BASE_URL;

// Get all domains (including custom domains / CNAMEs)
const domains = process.env.AGENTUITY_CLOUD_DOMAINS?.split(',');
```

<Callout type="info" title="Automatic CORS & Auth">
These variables are automatically used by the runtime for CORS origin validation and by `@agentuity/auth` for trusted origins. You only need to reference them directly if you have custom domain logic.
</Callout>

## Viewing Deployments

List recent deployments:
Expand Down
20 changes: 19 additions & 1 deletion content/Reference/sdk-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,20 @@ Agentuity applications access configuration and secrets through standard Node.js
- `AGENTUITY_SDK_KEY` - SDK-level API key (used in development to access Agentuity Cloud)
- `AGENTUITY_PROJECT_KEY` - Project-level API key (used when deployed)

**Platform-Injected Environment Variables (Cloud Deployments):**

These are automatically set by the Agentuity platform when your project is deployed. You do not need to configure them.

| Variable | Description |
|----------|-------------|
| `AGENTUITY_CLOUD_BASE_URL` | The base URL of your deployment (e.g., `https://dep-abc123.agentuity.cloud`). Used for authentication callbacks and as the canonical deployment URL. |
| `AGENTUITY_CLOUD_DOMAINS` | Comma-separated list of all domains for the deployment — includes the deployment URL, project URL, custom domains (CNAMEs), and PR preview URLs. |
| `AGENTUITY_CLOUD_ORG_ID` | Your organization ID. |
| `AGENTUITY_CLOUD_PROJECT_ID` | Your project ID. |
| `AGENTUITY_CLOUD_DEPLOYMENT_ID` | The current deployment ID. |

`AGENTUITY_CLOUD_BASE_URL` and `AGENTUITY_CLOUD_DOMAINS` are used automatically by the runtime for CORS origin validation and by `@agentuity/auth` for trusted origins.

**Example**

```typescript
Expand All @@ -143,9 +157,13 @@ const { server, logger } = await createApp();
const apiEndpoint = process.env.API_ENDPOINT || 'https://api.example.com';
const openaiKey = process.env.OPENAI_API_KEY;
// Optional: you can use the AI Gateway to access OpenAI, Anthropic, etc without needing to set various API keys.

// Access platform-injected variables (available in cloud deployments)
const deployedUrl = process.env.AGENTUITY_CLOUD_BASE_URL;
const allDomains = process.env.AGENTUITY_CLOUD_DOMAINS?.split(',');
```

**Note**: Environment variables are typically loaded from a `.env` file in development and configured in your deployment environment.
**Note**: Environment variables are typically loaded from a `.env` file in development and configured in your deployment environment. Platform-injected variables like `AGENTUITY_CLOUD_BASE_URL` and `AGENTUITY_CLOUD_DOMAINS` are only available when deployed to Agentuity Cloud.

---

Expand Down