Skip to content

Commit

Permalink
Update docs page about env vars (#541)
Browse files Browse the repository at this point in the history
This PR clarifies language about default env var
  • Loading branch information
mlejva authored Jan 17, 2025
2 parents 1108879 + c1a883b commit 2c4508e
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ This page covers how to set and use environment variables in a sandbox, and defa
## Default environment variables
### Knowing if you are inside a sandbox

<Note>
Sometimes it's useful to know if you are inside a sandbox. Upon creating a sandbox, an environment variable `E2B_SANDBOX` is set to `true`.
</Note>
Sometimes it's useful to know if the code is running inside a sandbox. Upon creating a sandbox, an environment variable `E2B_SANDBOX` is automatically set to `true`.
You can try it out by running the following code in the sandbox:

<CodeGroup>
```js
Expand All @@ -15,7 +14,7 @@ const result = await sandbox.commands.run('echo $E2B_SANDBOX')
```
```python
sandbox = Sandbox()
result = sandbox.run_code("import os; os.getenv('E2B_SANDBOX')")
result = sandbox.commands.run("echo $E2B_SANDBOX")
```
</CodeGroup>

Expand Down

0 comments on commit 2c4508e

Please sign in to comment.