Menu

Sandbox Authentication

Last updated January 31, 2026

The Sandbox SDK supports two authentication methods: Vercel OIDC tokens (recommended) and access tokens.

The SDK uses Vercel OpenID Connect (OIDC) tokens when available.

Local development: Download a development token by connecting to a Vercel project:

vercel link
vercel env pull

This 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: Vercel manages token expiration automatically when your code runs on Vercel.

Use access tokens when VERCEL_OIDC_TOKEN is unavailable, such as in external CI/CD systems or non-Vercel environments.

You need:

Set these as environment variables:

VERCEL_TEAM_ID=team_xxx
VERCEL_PROJECT_ID=prj_xxx
VERCEL_TOKEN=your_access_token

Then pass them to Sandbox.create():

ScenarioRecommended method
Local developmentOIDC token via vercel env pull
Deployed on VercelOIDC token (automatic)
External CI/CDAccess token
Non-Vercel hostingAccess token

Was this helpful?

supported.