ProjectDomain
Add and manage domains for Vercel projects.
Authentication
Section titled “Authentication”To use this resource, you must authenticate with Vercel. You can do this in one of two ways:
- Environment Variable: Set
VERCEL_ACCESS_TOKEN
in your.env
file. - Direct Prop: Pass
accessToken
directly in your resource configuration.
Examples
Section titled “Examples”Minimal
Section titled “Minimal”const domain = await ProjectDomain("my-app.com", { name: "my-app.com", project: "prj_123",});
With accessToken
Section titled “With accessToken”const domain = await ProjectDomain("my-app.com", { accessToken: alchemy.secret(process.env.VERCEL_ACCESS_TOKEN), name: "my-app.com", project: "prj_123",});
With redirect
Section titled “With redirect”const domain = await ProjectDomain("my-app.com", { name: "my-app.com", project: "prj_123", gitBranch: "main", redirect: "https://example.com", redirectStatusCode: 301,});