Skip to content
GitHubXDiscord

Project

Create and manage Vercel projects.

To use this resource, set VERCEL_ACCESS_TOKEN in your .env file or pass accessToken directly in your resource configuration.

const project = await Project("my-app", {
accessToken: alchemy.secret(process.env.VERCEL_ACCESS_TOKEN),
name: "my-app",
framework: "astro",
});
const project = await Project("my-app", {
name: "my-app",
framework: "nextjs",
gitRepository: {
type: "github",
repo: "username/my-app",
},
});
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",
},
],
});
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"),
},
],
});

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"),
},
],
});
const project = await Project("my-app", {
name: "my-app",
buildCommand: "npm run build",
outputDirectory: "dist",
installCommand: "npm install",
devCommand: "npm run dev",
});