Deploy to Vercel
One-click deploy with VM-level isolation
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/healthExpected 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.
- 1Go to your Vercel project settings
- 2Navigate to Environment Variables
- 3Add
EXECUTOR_API_KEYwith a secure random value - 4Redeploy your project to apply the changes
Environment Variables
Add custom environment variables for your tools in Vercel project settings:
| Variable | Required | Description |
|---|---|---|
EXECUTOR_API_KEY | No* | API key for authentication. Required for production. |
OPENAI_API_KEY | No | Example: Pass through to tools that need OpenAI |
DATABASE_URL | No | Example: 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/healthNote: 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:
- 1Creates an isolated VM for each tool execution
- 2Installs the npm package in the sandbox
- 3Executes the tool with your parameters
- 4Returns the result and destroys the sandbox
This provides VM-level isolation without the limitations of Node.js serverless functions.
Security
- Set
EXECUTOR_API_KEYto 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.
| Plan | Max Runtime | Notes |
|---|---|---|
| Hobby | 45 minutes | Free tier |
| Pro | 5 hours | For longer-running tools |
Region: Vercel Sandbox is currently only available in iad1 (US East).
Connect to TPMJS
- 1. Go to your collection or agent settings on TPMJS
- 2. Select "Custom Executor" in Executor Configuration
- 3. Enter URL:
https://tpmjs-executor.vercel.app - 4. Enter your API key (if configured)
- 5. Click "Verify Connection"