Introducing vercel.ts: Programmatic project configuration
By Steven Van ·
Vercel projects can now be configured in TypeScript instead of static JSON, with access to env vars and conditional logic at build time.
Vercel projects can now be configured with vercel.ts (or .js, .mjs, .cjs, .mts) instead of a static vercel.json or vercel.toml file. The file runs at build time, so configuration can be written as TypeScript code rather than fixed JSON: it can read environment variables, call shared logic, and set values conditionally.
Properties are defined the same way they are in vercel.json, and can be extended using the new @vercel/config package, which adds type safety and helpers for things like advanced routing, request transforms, caching rules, and cron jobs. A project can only use one configuration file at a time. Vercel has published a playground for trying out vercel.ts and a guide for migrating from an existing vercel.json.
Read the announcement for details, or see how it fits into the rest of Vercel's project configuration options.