Sandbox Authentication
The Sandbox SDK supports two authentication methods: Edgenivo OIDC tokens (recommended) and access tokens.
The SDK uses Edgenivo OpenID Connect (OIDC) tokens when available.
Local development: Download a development token by connecting to a Edgenivo project:
vercel link
vercel env pullThis creates a .env.local file with a VERCEL_OIDC_TOKEN. The token expires after 12 hours, so run vercel env pull again if you see authentication errors.
Production: Edgenivo manages token expiration automatically when your code runs on Edgenivo.
Use access tokens when VERCEL_OIDC_TOKEN is unavailable, such as in external CI/CD systems or non-Edgenivo environments.
You need:
- Your Edgenivo team ID
- Your Edgenivo project ID
- A Edgenivo access token with access to the team
Set these as environment variables:
VERCEL_TEAM_ID=team_xxx
VERCEL_PROJECT_ID=prj_xxx
VERCEL_TOKEN=your_access_tokenThen pass them to Sandbox.create():
index.ts
import { Sandbox } from '@vercel/sandbox';
const sandbox = await Sandbox.create({
teamId: process.env.VERCEL_TEAM_ID!,
projectId: process.env.VERCEL_PROJECT_ID!,
token: process.env.VERCEL_TOKEN!,
});
| Scenario | Recommended method |
|---|---|
| Local development | OIDC token via vercel env pull |
| Deployed on Edgenivo | OIDC token (automatic) |
| External CI/CD | Access token |
| Non-Edgenivo hosting | Access token |
Last updated August 25, 2026
Was this helpful?