Using Environment Variables with the Deploy Button
| Parameter | Type | Value |
|---|---|---|
| A comma-separated list of required environment variable keys. |
Use the parameter to require users to fill in values for environment variables that your project needs to run.
The example below shows how to use the parameter in a Deploy Button source URL:
You cannot pass environment variable values using this parameter because the URL is saved in the browser history, making it insecure.
| Parameter | Type | Value |
|---|---|---|
| A JSON-encoded object mapping environment variable keys to default values. |
Set non-sensitive default values for required environment variables with the parameter. When users click the Deploy Button, these defaults pre-populate the form so they can deploy faster or modify the values if needed.
Default values should only be used for non-sensitive configuration. Examples of appropriate use cases:
- Feature flags (e.g., )
- Public API endpoints (e.g., )
- Default configuration values (e.g., )
- Non-sensitive application settings
Never use default values for sensitive data like passwords, API keys, tokens, database credentials, or any secret values. Users should always enter these manually.
The parameter expects a JSON object where keys are the environment variable names (which must also be listed in the parameter), and values are the default values. The JSON must be URI-encoded.
The example below shows how to use the parameter:
The decoded JSON in this example is:
Default values only apply if the environment variable is listed in the parameter. Users can still modify or clear these values before deploying.
| Parameter | Type | Value |
|---|---|---|
| A short description of the required environment variables |
Add a description that explains what the required environment variables are used for with the parameter. The description should be URL-encoded.
The description provided through this parameter only shows if required environment variables are set.
The example below shows how to use the parameter in a Deploy Button source URL:
| Parameter | Type | Value |
|---|---|---|
| A link to an explanation of the required environment variables |
Attach a link to external documentation that helps users find the values they need with the parameter. This link should point to specific documentation about your environment variables, not top-level docs.
The link provided through this parameter only shows if required environment variables are set.
The example below shows how to use the parameter in a Deploy Button source URL. Make sure you provide users with a specific link instead of top-level documentation:
Was this helpful?