Skip to content
GitHubXDiscordRSS

ProjectDomain

Learn how to create and manage Vercel Project Domains with Alchemy

Add and manage domains for Vercel projects.

To use this resource, you must authenticate with Vercel. You can do this in one of two ways:

  1. Environment Variable: Set VERCEL_ACCESS_TOKEN in your .env file.
  2. Direct Prop: Pass accessToken directly in your resource configuration.
const domain = await ProjectDomain("my-app.com", {
name: "my-app.com",
project: "prj_123",
});
const domain = await ProjectDomain("my-app.com", {
accessToken: alchemy.secret(process.env.VERCEL_ACCESS_TOKEN),
name: "my-app.com",
project: "prj_123",
});
const domain = await ProjectDomain("my-app.com", {
name: "my-app.com",
project: "prj_123",
gitBranch: "main",
redirect: "https://example.com",
redirectStatusCode: 301,
});