Deploy to Vercel

One-click deploy with VM-level isolation

1-click
Deploy instantly
VM
Sandbox isolation
Free
Hobby tier available

One-Click Deploy

Deploy the TPMJS executor template to your Vercel account:

After deployment, your executor will be available at https://tpmjs-executor.vercel.app

Test Your Deployment

Verify your executor is running:

curl https://your-executor.vercel.app/api/health

Expected response:

{
  "status": "ok",
  "version": "1.0.0",
  "info": {
    "runtime": "vercel-sandbox",
    "region": "iad1",
    "timestamp": "2024-01-01T00:00:00.000Z"
  }
}

Add Authentication

Important: Without an API key, anyone can execute tools on your executor. Always set EXECUTOR_API_KEY in production.

  1. 1Go to your Vercel project settings
  2. 2Navigate to Environment Variables
  3. 3Add EXECUTOR_API_KEY with a secure random value
  4. 4Redeploy your project to apply the changes

Environment Variables

Add custom environment variables for your tools in Vercel project settings:

VariableRequiredDescription
EXECUTOR_API_KEYNo*API key for authentication. Required for production.
OPENAI_API_KEYNoExample: Pass through to tools that need OpenAI
DATABASE_URLNoExample: Pass through to tools that need database

* Strongly recommended for production deployments

Execute a Tool

Test tool execution with a curl request:

curl -X POST https://your-executor.vercel.app/api/execute-tool \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your-api-key" \
  -d '{
    "packageName": "@tpmjs/hello",
    "name": "helloWorld",
    "version": "latest",
    "params": { "name": "World" }
  }'

Local Development

Run the executor locally for testing. Note: Vercel Sandbox requires authentication even in development.

# Clone and install
git clone https://github.com/tpmjs/tpmjs.git
cd tpmjs/templates/vercel-executor
npm install

# Login to Vercel (required for sandbox)
vercel login
vercel link

# Pull environment variables
vercel env pull

# Run development server
npm run dev

# Test health endpoint
curl http://localhost:3000/api/health

Note: You must run vercel login and vercel link before local development. Vercel Sandbox requires authentication to create VMs.

How It Works

The Vercel executor uses Vercel Sandbox for isolated execution:

  1. 1Creates an isolated VM for each tool execution
  2. 2Installs the npm package in the sandbox
  3. 3Executes the tool with your parameters
  4. 4Returns the result and destroys the sandbox

This provides VM-level isolation without the limitations of Node.js serverless functions.

Security

  • Set EXECUTOR_API_KEY to require authentication
  • Tools run in isolated VMs with no access to your Vercel project
  • Each execution gets a fresh sandbox instance
  • Sandboxes are destroyed after execution completes

Pricing & Limits

Vercel Sandbox usage is billed based on compute time. See Vercel Sandbox Pricing for current rates.

PlanMax RuntimeNotes
Hobby45 minutesFree tier
Pro5 hoursFor longer-running tools

Region: Vercel Sandbox is currently only available in iad1 (US East).

Connect to TPMJS

  1. 1. Go to your collection or agent settings on TPMJS
  2. 2. Select "Custom Executor" in Executor Configuration
  3. 3. Enter URL: https://tpmjs-executor.vercel.app
  4. 4. Enter your API key (if configured)
  5. 5. Click "Verify Connection"