-
Notifications
You must be signed in to change notification settings - Fork 492
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add environment variables to docs (#210)
- Loading branch information
Showing
10 changed files
with
85 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Setting environment variables | ||
|
||
## Global environment variables | ||
You can set the sandbox's global environment variables when you're initializing a new sandbox. | ||
<CodeGroupAutoload | ||
path="basics/set_env_vars" | ||
isRunnable={false} | ||
/> | ||
|
||
|
||
## Environment variables per process | ||
Alternatively, you can set environment variables when starting a new process. These environment variables are accessible only for this process. | ||
|
||
<Note> | ||
Environment variables set when starting a a new process have precedence over the environment variables set when initializing the sandbox. | ||
</Note> | ||
|
||
<CodeGroupAutoload | ||
path="basics/process_env_vars" | ||
isRunnable={true} | ||
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# Sandbox Resources | ||
# Sandbox resources | ||
|
||
### Available resources | ||
- 4 vCPU {{ className: 'lead' }} | ||
- 1GB RAM {{ className: 'lead' }} | ||
- 2.5GB storage {{ className: 'lead' }} | ||
|
||
If you need more resources, please [contact us](mailto:hello@e2b.dev) with your use case. | ||
If you need more resources, please [reach out to us](/getting-help) with your use case. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Session } from '@e2b/sdk' | ||
|
||
const session = await Session.create({ | ||
id: 'Nodejs', | ||
envVars: { FOO: 'Hello' }, | ||
}) | ||
|
||
const proc = await session.process.start({ | ||
cmd: 'echo $FOO $BAR!', | ||
envVars: { BAR: 'World' }, // $HighlightLine | ||
}) | ||
await proc.wait() | ||
console.log(proc.output.stdout) | ||
// output: Hello World! | ||
|
||
await session.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from e2b import Session | ||
|
||
session = Session.create( | ||
id="Nodejs", | ||
env_vars={"FOO": "Hello"} | ||
) | ||
|
||
proc = session.process.start( | ||
"echo $FOO $BAR!", | ||
env_vars={"BAR": "World"}, # $HighlightLine | ||
) | ||
proc.wait() | ||
|
||
print(proc.output.stdout) | ||
# output: Hello World! | ||
|
||
session.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f7aabdb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
e2b-docs – ./apps/docs
e2b-docs-git-main-e2b.vercel.app
e2b-docs-e2b.vercel.app
e2b-docs.vercel.app