Skip to content
Merged
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
1 change: 1 addition & 0 deletions docs/sandboxes/environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The following environment variables are typically available within Codegen sandb
| `NPM_CONFIG_YES` | `"true"` | Configures npm to automatically answer "yes" to prompts. |
| `PIP_NO_INPUT` | `"1"` | Instructs pip (Python's package installer) to operate in non-interactive mode. |
| `YARN_ENABLE_IMMUTABLE_INSTALLS` | `"false"` | Disables Yarn's "immutable installs" feature, allowing `yarn install` to modify the lockfile. |
| `CG_PREVIEW_URL` | _Dynamic (preview URL)_ | Contains the URL where the web preview will be served. This is automatically set when Web Preview is configured. |

<Note>
The values for variables like `NVM_DIR`, `PATH`, `NVM_BIN`, and `NODE_VERSION`
Expand Down
7 changes: 7 additions & 0 deletions docs/sandboxes/web-preview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ bundle exec rails server -b 127.0.0.1 -p 3000
Variables](./environment-variables).
</Tip>

<Tip>
The `CG_PREVIEW_URL` environment variable is automatically set and contains
the URL where your web preview will be accessible. Use this in your
application code when you need to reference the preview URL programmatically
(e.g., for CORS configuration, webhooks, or generating absolute URLs).
</Tip>

<Note>
The web preview is intended for development and debugging purposes. The server
is typically only accessible while the agent run is active or for a short
Expand Down