Skip to content

Commit d0700b9

Browse files
committed
Rename sbx to sandbox in template examples
Use the full 'sandbox' variable name for better readability.
1 parent 328241d commit d0700b9

6 files changed

Lines changed: 24 additions & 24 deletions

File tree

docs/template/examples/claude-code.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ Create a sandbox with your Anthropic API key and pipe prompts to Claude. It can
7777
```typescript JavaScript & TypeScript
7878
import { Sandbox } from 'e2b'
7979

80-
const sbx = await Sandbox.create('claude-code', {
80+
const sandbox = await Sandbox.create('claude-code', {
8181
timeoutMs: 60_000,
8282
envs: {
8383
ANTHROPIC_API_KEY: '<your api key>',
8484
},
8585
})
8686

87-
const result = await sbx.commands.run(
87+
const result = await sandbox.commands.run(
8888
`echo 'Create a hello world index.html' | claude -p --dangerously-skip-permissions`,
8989
{ timeoutMs: 0 }
9090
)
@@ -94,15 +94,15 @@ console.log(result.stdout)
9494
```python Python
9595
from e2b import Sandbox
9696

97-
sbx = Sandbox(
97+
sandbox = Sandbox(
9898
'claude-code',
9999
timeout=60,
100100
envs={
101101
'ANTHROPIC_API_KEY': '<your api key>',
102102
},
103103
)
104104

105-
result = sbx.commands.run(
105+
result = sandbox.commands.run(
106106
"echo 'Create a hello world index.html' | claude -p --dangerously-skip-permissions",
107107
timeout=0,
108108
)

docs/template/examples/desktop.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,18 @@ Create a sandbox and open the URL in your browser. You'll see a full Ubuntu desk
188188
```typescript JavaScript & TypeScript
189189
import { Sandbox } from 'e2b'
190190

191-
const sbx = await Sandbox.create('desktop', { timeoutMs: 60_000 })
191+
const sandbox = await Sandbox.create('desktop', { timeoutMs: 60_000 })
192192

193-
const url = sbx.getHost(6080)
193+
const url = sandbox.getHost(6080)
194194
console.log('Desktop available at:', url)
195195
```
196196

197197
```python Python
198198
from e2b import Sandbox
199199

200-
sbx = Sandbox('desktop', timeout=60)
200+
sandbox = Sandbox('desktop', timeout=60)
201201

202-
url = sbx.get_host(6080)
202+
url = sandbox.get_host(6080)
203203
print('Desktop available at:', url)
204204
```
205205

docs/template/examples/docker.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,18 @@ Spin up a sandbox and run any Docker image you need.
7171
```typescript JavaScript & TypeScript
7272
import { Sandbox } from 'e2b'
7373

74-
const sbx = await Sandbox.create('e2b-docker-template', { timeoutMs: 60_000 })
74+
const sandbox = await Sandbox.create('e2b-docker-template', { timeoutMs: 60_000 })
7575

76-
const result = await sbx.commands.run('sudo docker run --rm alpine echo "Hello from Alpine!"')
76+
const result = await sandbox.commands.run('sudo docker run --rm alpine echo "Hello from Alpine!"')
7777
console.log(result.stdout)
7878
```
7979

8080
```python Python
8181
from e2b import Sandbox
8282

83-
sbx = Sandbox('e2b-docker-template', timeout=60)
83+
sandbox = Sandbox('e2b-docker-template', timeout=60)
8484

85-
result = sbx.commands.run('sudo docker run --rm alpine echo "Hello from Alpine!"')
85+
result = sandbox.commands.run('sudo docker run --rm alpine echo "Hello from Alpine!"')
8686
print(result.stdout)
8787
```
8888
</CodeGroup>

docs/template/examples/expo.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,18 @@ Create a sandbox and get the URL. Open it in your browser to see the Expo web pr
7777
```typescript JavaScript & TypeScript
7878
import { Sandbox } from 'e2b'
7979

80-
const sbx = await Sandbox.create('expo-app', { timeoutMs: 60_000 })
80+
const sandbox = await Sandbox.create('expo-app', { timeoutMs: 60_000 })
8181

82-
const url = sbx.getHost(8081)
82+
const url = sandbox.getHost(8081)
8383
console.log('Expo app running at:', url)
8484
```
8585

8686
```python Python
8787
from e2b import Sandbox
8888

89-
sbx = Sandbox('expo-app', timeout=60)
89+
sandbox = Sandbox('expo-app', timeout=60)
9090

91-
url = sbx.get_host(8081)
91+
url = sandbox.get_host(8081)
9292
print('Expo app running at:', url)
9393
```
9494
</CodeGroup>

docs/template/examples/nextjs-bun.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,18 @@ Create a sandbox and grab the URL. The dev server with Turbopack is already runn
8585
```typescript JavaScript & TypeScript
8686
import { Sandbox } from 'e2b'
8787

88-
const sbx = await Sandbox.create('nextjs-app-bun', { timeoutMs: 60_000 })
88+
const sandbox = await Sandbox.create('nextjs-app-bun', { timeoutMs: 60_000 })
8989

90-
const url = sbx.getHost(3000)
90+
const url = sandbox.getHost(3000)
9191
console.log('Next.js app running at:', url)
9292
```
9393

9494
```python Python
9595
from e2b import Sandbox
9696

97-
sbx = Sandbox('nextjs-app-bun', timeout=60)
97+
sandbox = Sandbox('nextjs-app-bun', timeout=60)
9898

99-
url = sbx.get_host(3000)
99+
url = sandbox.get_host(3000)
100100
print('Next.js app running at:', url)
101101
```
102102
</CodeGroup>

docs/template/examples/nextjs.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,18 +87,18 @@ Create a sandbox and grab the URL. The dev server with Turbopack is already runn
8787
```typescript JavaScript & TypeScript
8888
import { Sandbox } from 'e2b'
8989

90-
const sbx = await Sandbox.create('nextjs-app', { timeoutMs: 60_000 })
90+
const sandbox = await Sandbox.create('nextjs-app', { timeoutMs: 60_000 })
9191

92-
const url = sbx.getHost(3000)
92+
const url = sandbox.getHost(3000)
9393
console.log('Next.js app running at:', url)
9494
```
9595

9696
```python Python
9797
from e2b import Sandbox
9898

99-
sbx = Sandbox('nextjs-app', timeout=60)
99+
sandbox = Sandbox('nextjs-app', timeout=60)
100100

101-
url = sbx.get_host(3000)
101+
url = sandbox.get_host(3000)
102102
print('Next.js app running at:', url)
103103
```
104104
</CodeGroup>

0 commit comments

Comments
 (0)