Skip to content

Commit 105ea0b

Browse files
authored
adds docs around web preview (#1266)
# Motivation <!-- Why is this change necessary? --> # Content <!-- Please include a summary of the change --> # Testing <!-- How was the change tested? --> # Please check the following before marking your PR as ready for review - [ ] I have added tests for my changes - [ ] I have updated the documentation or added new documentation as needed
1 parent c8335b3 commit 105ea0b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docs/sandboxes/environment-variables.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The following environment variables are typically available within Codegen sandb
2525
| `NPM_CONFIG_YES` | `"true"` | Configures npm to automatically answer "yes" to prompts. |
2626
| `PIP_NO_INPUT` | `"1"` | Instructs pip (Python's package installer) to operate in non-interactive mode. |
2727
| `YARN_ENABLE_IMMUTABLE_INSTALLS` | `"false"` | Disables Yarn's "immutable installs" feature, allowing `yarn install` to modify the lockfile. |
28+
| `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. |
2829

2930
<Note>
3031
The values for variables like `NVM_DIR`, `PATH`, `NVM_BIN`, and `NODE_VERSION`

docs/sandboxes/web-preview.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ bundle exec rails server -b 127.0.0.1 -p 3000
5757
Variables](./environment-variables).
5858
</Tip>
5959

60+
<Tip>
61+
The `CG_PREVIEW_URL` environment variable is automatically set and contains
62+
the URL where your web preview will be accessible. Use this in your
63+
application code when you need to reference the preview URL programmatically
64+
(e.g., for CORS configuration, webhooks, or generating absolute URLs).
65+
</Tip>
66+
6067
<Note>
6168
The web preview is intended for development and debugging purposes. The server
6269
is typically only accessible while the agent run is active or for a short

0 commit comments

Comments
 (0)