VercelDeployer
The VercelDeployer
class handles deployment of standalone Mastra applications to Vercel. It manages configuration, deployment, and extends the base Deployer class with Vercel specific functionality.
Usage example
src/mastra/index.ts
import { Mastra } from "@mastra/core/mastra";
import { VercelDeployer } from "@mastra/deployer-vercel";
export const mastra = new Mastra({
// ...
deployer: new VercelDeployer()
});
Constructor options
The deployer supports a small set of high‑value overrides that are written to the Vercel Output API function config (.vc-config.json
):
maxDuration?: number
— Function execution timeout (in seconds)memory?: number
— Function memory (in MB)regions?: string[]
— Regions to deploy the function (e.g.['sfo1','iad1']
)
These options are merged into .vercel/output/functions/index.func/.vc-config.json
while preserving default fields (handler
, launcherType
, runtime
, shouldAddHelpers
).
Example with overrides
src/mastra/index.ts
import { Mastra } from "@mastra/core/mastra";
import { VercelDeployer } from "@mastra/deployer-vercel";
export const mastra = new Mastra({
// ...
deployer: new VercelDeployer({
maxDuration: 600,
memory: 1536,
regions: ["sfo1", "iad1"],
}),
});