Overview
This guide walks you through deploying your crypto application with AI assistance. While there are many deployment platforms available (like Netlify, Railway, Render, or AWS), this guide focuses on Vercel as a popular option for web applications. Why use Vercel?- Automatic deployments: Just push to GitHub and your app goes live instantly (great for rapid iteration and sharing with others)
- Global performance: Your app loads fast worldwide through their CDN
- Built-in HTTPS: Secure connections for handling crypto transactions
- Preview deployments: Test changes safely before they go live
- Easy environment variables: Secure storage for your API keys
Environment variables
Based on your app type, you’ll need different environment variables. Check your.env
file from your scaffolded project for the variables you need.
Why use Vercel environment variables
- Security: Your secrets are encrypted and stored safely (not in your code where others could see them)
- Flexibility: Use different API keys for testing vs production
- Convenience: Vercel automatically adds these variables to your app when it builds
- Team-friendly: Share projects without sharing secret files
Best practices
- Keep secrets private: Only use
NEXT_PUBLIC_
prefix if the variable needs to be visible in the browser (most API keys should NOT have this prefix) - Use Vercel’s dashboard: Add variables through the Vercel interface rather than putting them in code
- Update keys regularly: Change your API keys periodically for security
- Rebuild after changes: If you change environment variables, trigger a new deployment so they take effect
Never commit secrets in .env files to GitHub. This can expose your API keys and compromise your CDP account. Always use Vercel’s environment variable management instead.
Vercel deployment
If your repository is pushed to version control (GitHub, GitLab, or Bitbucket), you can import the repository to Vercel, a tool used for hosting and deploying web applications with automatic builds and deployments.Prerequisites
Before deploying to Vercel, make sure you have:- Existing app integrated with CDP - Follow the starter app setup guide if you haven’t created one yet
- Repository pushed to version control - Your code should be in GitHub, GitLab, or Bitbucket
Initial setup
1
Import repository to Vercel
- Go to vercel.com and under “Import Git Repository,” select your version control system
- Import your repository
- Vercel will automatically detect your framework and configure build settings
2
Configure Environment Variables
In your Vercel dashboard:
- Go to your project page → Settings → Environment Variables (or visit
vercel.com/[your-username]/[your-project]/settings/environment-variables
) - Add the variables from your
.env
file - The exact variables depend on your starter app type (Consumer App, DeFi App, or AI Agent) - Set different values for Preview (development) vs Production
Never commit API keys to your code. Always use environment variables to keep your secrets secure.
3
Simple Deployment Workflow
- GitHub receives your commit - Code is stored safely
- Vercel detects the change - Deployment starts automatically
- Build process runs - Your app is compiled and optimized
- Live deployment - New version goes live at your domain
- Preview deployments - Every branch gets its own preview URL
Troubleshooting with AI
When deployments fail, you can use AI to help diagnose and fix issues quickly.Build failures
When Vercel can’t build your app (you’ll see errors in the deployment log):Environment variable issues
When your app works locally but can’t find your API keys after deployment:Network connection problems
When your app works locally but can’t connect to blockchain networks after deployment:Common fixes with AI help
Code style errors (linting)
First, try to auto-fix common code style issues:Slow loading apps
If your deployed app feels slow, ask AI to help optimize it:What to read next
- AI Debugging: Debug production issues with AI assistance and systematic troubleshooting
- Testing Strategies: Ensure quality before deployment with comprehensive testing approaches
- AI Development Workflows: Core development patterns and workflow processes