deployers/vercel/README.md
A Vercel deployer for Mastra applications.
pnpm add @mastra/deployer-vercel
The Vercel deployer is used as part of the Mastra framework:
import { Mastra } from '@mastra/core/mastra';
import { VercelDeployer } from '@mastra/deployer-vercel';
const deployer = new VercelDeployer({
// Optional per-function overrides (written to .vc-config.json)
maxDuration: 600,
memory: 1536,
regions: ['sfo1', 'iad1'],
});
const mastra = new Mastra({
deployer,
// ... other Mastra configuration options
});
High‑value overrides written to .vercel/output/functions/index.func/.vc-config.json:
maxDuration?: number — Function execution timeout (seconds)memory?: number — Function memory (MB)regions?: string[] — Regions (e.g. ['sfo1','iad1'])The deployer creates:
your-project/
├── vercel.json # Deployment configuration
└── index.mjs # Application entry point
Default configuration:
{
"version": 2,
"installCommand": "npm install --omit=dev",
"builds": [
{
"src": "index.mjs",
"use": "@vercel/node",
"config": {
"includeFiles": ["**"]
}
}
],
"routes": [
{
"src": "/(.*)",
"dest": "index.mjs"
}
]
}
Environment variables are handled automatically through:
.env files in your projectThe deployer: