Prerequisites
- An Evidence project in a Git repository (GitHub, GitLab, or Bitbucket)
- A Vercel account
- Your data sources configured and tested locally
Deployment Steps
git init
git add .
git commit -m "Initial commit"
git remote add origin <your-repository-url>
git push -u origin main
npm run sources && npm run buildbuildnpm installEVIDENCE_ prefix for Evidence-specific variablesEVIDENCE_SOURCE__[datasource]__hostEVIDENCE_SOURCE__[datasource]__databaseEVIDENCE_SOURCE__[datasource]__userEVIDENCE_SOURCE__[datasource]__passwordConfiguration Options
Custom Domain
To add a custom domain:- Go to Settings > Domains
- Click Add
- Enter your domain name
- Configure DNS records as instructed
Build Settings Override
Create avercel.json file in your project root:
Redirects and Rewrites
Add redirects to yourvercel.json:
Preview Deployments
Vercel automatically creates preview deployments for:- Every push to a branch
- Every pull request
Continuous Deployment
Vercel automatically deploys your site when you push to your repository:Using Vercel CLI
Deploy directly from your terminal:Troubleshooting
Build Fails with Memory Error
Increase Node.js memory invercel.json:
Build Command Not Found
Ensure yourpackage.json includes:
Environment Variables Not Working
- Verify variables are set for the correct environment (Production/Preview/Development)
- Check variable names match exactly (case-sensitive)
- Redeploy after adding new environment variables
- Review deployment logs for specific errors
Data Source Connection Timeout
- Ensure your database allows connections from Vercel’s IP ranges
- Increase timeout values in your connection string
- Consider using a connection pooler for serverless-friendly connections
Build Exceeds Time Limit
Optimize your build:- Use
npm run sources -- --changedto build only modified queries - Reduce data volume in source queries
- Pre-aggregate data in your database
- Consider upgrading to a Vercel Pro plan for longer build times
Advanced Configuration
Monorepo Deployment
For monorepos, specify the root directory:SPA Mode
To deploy as a Single Page Application:Next Steps
- Configure rendering modes
- Set up GitHub integration for PR comments
- Enable deployment protection