Quickstart
This guide shows you how to run your first code in a Vercel Sandbox.
- A Vercel account
- Vercel CLI installed (
npm i -g vercel) - Node.js 22+ or Python 3.10+
Create a new directory and connect it to a Vercel project. This is the recommended way to authenticate because the project handles secure OIDC token authentication for you.
When prompted, select Create a new project. The project doesn't need any code deployed. It just needs to exist so Vercel can generate authentication tokens for you.
Once linked, pull your environment variables to get an authentication token:
Terminalvercel env pullThis creates a
.env.localfile containing a token that the SDK uses to authenticate your requests. When you deploy to Vercel, token management happens automatically.Create a file that creates a sandbox and runs a command:
You should see:
Hello from Vercel Sandbox!Sandboxes automatically stop after 5 minutes. To adjust this or manage running sandboxes, see Working with Sandbox.
- Set up authentication: Connected to a Vercel project and pulled credentials to enable sandbox creation.
- Created a sandbox: Spun up an isolated Linux microVM.
- Ran a command: Executed code inside the secure environment.
- SDK Reference: Full API documentation for TypeScript and Python.
- CLI Reference: Manage sandboxes from the terminal.
- Snapshots: Save sandbox state to skip setup on future runs.
- Examples: See real-world use cases.
Was this helpful?