Skip to content
Dashboard

Vercel Sandbox now accepts environment variables at creation

Software Engineer, Infrastructure
await using sandbox = await Sandbox.create({
env: { HELLO: "world", DEBUG: "true" },
});
// Prints "world" (inherited from Sandbox.create)
await sandbox.runCommand({ cmd: "node", args: ["-p", "process.env.HELLO"] });
// Prints "false" (overrides the DEBUG value)
await sandbox.runCommand({ cmd: "node", args: ["-p", "process.env.DEBUG"], env: { DEBUG: "false" } });