Reference
2 min read

Using Environment Variables with the Deploy Button

Learn how to use Environment Variables with the Vercel Deploy Button.
Table of Contents
ParameterTypeValue
envstring[]A comma-separated list of required Environment Variable keys.

The Required Environment Variables parameter allows you to require users to fill in values of Environment Variables the new project needs to run successfully.

The example below shows how to use the env parameter in a Deploy Button source URL:

env
https://vercel.com/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fnext.js%2Ftree%2Fcanary%2Fexamples%2Fhello-world&env=PUBLIC_API_KEY,API_SECRET_KEY

You cannot pass Environment Variable values using this parameter due to the URL being saved in the browser history, and thus not being a secure method.

ParameterValueType
envDescriptionA short description of the Required Environment Variables: Enter your public API Key.String
ParameterTypeValue
envDescriptionstringA short description of the required Environment Variables

The Environment Variables Description parameter allows you to define a URL encoded string that describes to a user what the Required Environment Variables are used for.

The description provided through this parameter will only show if Required Environment Variables are set.

The example below shows how to use the envDescription parameter in a Deploy Button source URL:

envDescription
https://vercel.com/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fnext.js%2Ftree%2Fcanary%2Fexamples%2Fhello-world&env=PUBLIC_API_KEY&envDescription=Enter%20your%20public%20API%20Key.
ParameterTypeValue
envLinkstringA link to an explanation of the required Environment Variables

The Environment Variable Link parameter allows you to attach a link to external documentation that helps the user find more information about where the values for the Environment Variables can be found and what they are for.

The description provided through this parameter will only show if Required Environment Variables are set.

The example below shows how to use the envLink parameter in a Deploy Button source URL. Make sure you provide users with a specific link instead of top-level documentation:

envLink
https://vercel.com/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel%2Fnext.js%2Ftree%2Fcanary%2Fexamples%2Fhello-world&env=PUBLIC_API_KEY&envLink=https%3A%2F%2Fvercel.com%2Fdocs
Last updated on April 25, 2024