Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Fix docs build (#866)

Jakub Novák400bb86e416e
diff --git a/apps/web/src/lib/utils.ts b/apps/web/src/lib/utils.ts
index 2e5021059..b5286fa14 100644
--- a/apps/web/src/lib/utils.ts
+++ b/apps/web/src/lib/utils.ts
@@ -8,6 +8,10 @@ export function cn(...inputs: ClassValue[]) {
// Verify that the sandbox exists and is associated with the API key
export async function verifySandbox(apiKey: string, sandboxId: string) {
- const sandboxes = await Sandbox.list({ apiKey })
- return sandboxes.some((sandbox) => sandbox.sandboxId === sandboxId)
-}
\ No newline at end of file
+ try {
+ const sandbox = await Sandbox.getInfo(sandboxId, { apiKey })
+ return sandbox.state === 'running'
+ } catch (error) {
+ return false
+ }
+}