Skip to content

Commit 6ec8f69

Browse files
Muhammad-Bin-AliMuhammad Ali
andauthored
Fix sandbox env vars type annotations (#28544)
* Fix DurableObjectNamespace type annotations in env vars examples * Remove trailing comma in JSONC wrangler config example --------- Co-authored-by: Muhammad Ali <muhammadali@cloudflare.com>
1 parent 68f5a8c commit 6ec8f69

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/content/docs/sandbox/configuration/environment-variables.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Controls the transport protocol for SDK-to-container communication. WebSocket tr
2727
{
2828
"vars": {
2929
"SANDBOX_TRANSPORT": "websocket"
30-
},
30+
}
3131
}
3232
```
3333
</WranglerConfig>
@@ -183,9 +183,10 @@ Then pass them to your sandbox:
183183

184184
```typescript
185185
import { getSandbox } from "@cloudflare/sandbox";
186+
export { Sandbox } from "@cloudflare/sandbox";
186187

187188
interface Env {
188-
Sandbox: DurableObjectNamespace;
189+
Sandbox: DurableObjectNamespace<Sandbox>;
189190
OPENAI_API_KEY: string;
190191
DATABASE_URL: string;
191192
}
@@ -278,9 +279,10 @@ Bucket mounting requires production deployment. It does not work with `wrangler
278279

279280
```typescript
280281
import { getSandbox } from "@cloudflare/sandbox";
282+
export { Sandbox } from "@cloudflare/sandbox";
281283

282284
interface Env {
283-
Sandbox: DurableObjectNamespace;
285+
Sandbox: DurableObjectNamespace<Sandbox>;
284286
AWS_ACCESS_KEY_ID: string;
285287
AWS_SECRET_ACCESS_KEY: string;
286288
}

0 commit comments

Comments
 (0)