Project
Create and manage Vercel projects.
Authentication
Section titled “Authentication”To use this resource, set VERCEL_ACCESS_TOKEN
in your .env
file or pass accessToken
directly in your resource configuration.
Examples
Section titled “Examples”With accessToken
Section titled “With accessToken”const project = await Project("my-app", { accessToken: alchemy.secret(process.env.VERCEL_ACCESS_TOKEN), name: "my-app", framework: "astro",});
With GitHub
Section titled “With GitHub”const project = await Project("my-app", { name: "my-app", framework: "nextjs", gitRepository: { type: "github", repo: "username/my-app", },});
With Environment Variables
Section titled “With Environment Variables”Plain Text
Section titled “Plain Text”const project = await Project("my-app", { name: "my-app", environmentVariables: [ { key: "PUBLIC_URL", target: ["production", "preview", "development"], // `type: "plain"` default when `value` is a string value: "https://example.com", }, ],});
Encrypted
Section titled “Encrypted”const project = await Project("my-app", { name: "my-app", environmentVariables: [ { key: "DATABASE_URL", target: ["production", "preview"], // `type: "encrypted"` is the default when `value` is a Secret value: alchemy.secret("DATABASE_URL"), }, ],});
Sensitive
Section titled “Sensitive”https://vercel.com/docs/environment-variables/sensitive-environment-variables
const project = await Project("my-app", { name: "my-app", environmentVariables: [ { key: "DATABASE_URL", target: ["production", "preview"], type: "sensitive", value: alchemy.secret("DATABASE_URL"), }, ],});
With Custom Build Settings
Section titled “With Custom Build Settings”const project = await Project("my-app", { name: "my-app", buildCommand: "npm run build", outputDirectory: "dist", installCommand: "npm install", devCommand: "npm run dev",});