Setting Up Bugster with Vercel Automation for Protected Deployments
Setting Up Bugster with Vercel Automation for Protected Deployments
Integrating Bugster with Vercel's preview deployments provides a powerful way to automatically test your changes before they go live. In this guide, we'll walk you through setting up Vercel automation for repositories with protected deployments.
What You'll Learn
By the end of this tutorial, you'll know how to:
- Set up Vercel automation API for your project
- Configure Bugster to work with protected Vercel deployments
- Run automated tests in your preview deployments
Prerequisites
- A Vercel account with admin access to your project
- A repository with protected deployments enabled
- Bugster CLI installed and configured in your project
Step 1: Setting Up Vercel Automation API
First, we'll need to set up the automation API in your Vercel project settings. This process is straightforward and only needs to be done once per project.
Accessing Project Settings
- Log in to your Vercel dashboard
- Select the project you want to configure
- Click on the "Settings" tab in the main navigation
- From the settings menu, select "Deployment Protection"
Enabling Protection Bypass for Automation
- In the Deployment Protection settings, scroll down to find the "Protection Bypass for Automation" section
- Click on "Generate New Secret" to create a new API key
- A new secret will be generated - this will be your
x-vercel-protection-bypass
token
Watch this video to see the process of copying the API key:
Important Security Notes
- Store this API key securely - it provides access to all protected deployments in your project
- The key will be automatically added to your deployments as
VERCEL_AUTOMATION_BYPASS_SECRET
- If you need to rotate the key, you can generate a new one at any time
- Remember that regenerating the key will invalidate the previous one
Step 2: Configuring Bugster for Protected Deployments
Once you have your Vercel automation API key, you'll need to configure Bugster to use it for protected deployments.
Adding the Vercel API Key to Bugster Configuration
Open your IDE and locate the .bugster/config.yaml
file in your project. You'll need to add the Vercel API key to enable access to protected deployments.
Add the following configuration to your config.yaml
:
x-vercel-protection-bypass: "<your-vercel-api-key>"
Replace <your-vercel-api-key>
with the API key you obtained from the Vercel dashboard.
How It Works
When you push changes to your repository:
- Vercel creates a preview deployment
- Bugster detects the preview URL
- The configured API key allows Bugster to access the protected deployment
- Tests run automatically against the preview environment
- Results are reported back to your pull request
Troubleshooting
If you encounter issues:
- Verify the API key is correctly formatted in your
config.yaml
- Ensure the API key has the correct permissions in Vercel
- Check that protected deployments are properly configured
- Verify your Bugster configuration is up to date