@vercel/related-projects
Utilities for stitching together Vercel deployments across multiple projects.
Usage
Install
pnpm add @vercel/related-projects
Configure related projects
{
"relatedProjects": ["prj_123", "prj_456"]
}
Retrieve related projects data
import { relatedProjects } from '@vercel/related-projects';
const projects = relatedProjects();
Reference hosts of related projects
import { withRelatedProject } from '@vercel/related-projects';
const apiHost = withRelatedProject({
projectName: 'my-api-project',
defaultHost: process.env.API_HOST,
});
This can replace all usages of:
const apiHost = process.env.API_HOST;
Access related projects types
import type { VercelRelatedProject } from '@vercel/related-projects';