1 min read


The new @vercel/related-projects
package helps sync deployment information across separate Vercel projects, ensuring your applications always reference the latest preview or production deployment URLs without manual updates or environment variable changes.
Previously, developers had to manually enter deployment URLs, manage connection strings, or use environment variables to keep the projects communicating effectively. Now, this data is automatically available and updated at both build and runtime.
For example, a monorepo containing:
A frontend Next.js project that fetches data from an API
An backend Express.js API project that serves the data
Related Projects can now ensure that each preview deployment of the frontend automatically references the corresponding preview deployment of the backend, avoiding the need for hardcoded values when testing changes that span both projects.
Related Projects are linked using a Vercel project ID. You can find your project ID in the project Settings page in the Vercel dashboard.
- const host = process.env.API_URL as string+ const host = withRelatedProject({+ projectName: "api-project",+ defaultHost: process.env.API_URL as string,+ });
Example of connecting a frontend project to a separate backend API.
Learn more about linking related projects.