Configure Environment Variables

Add all your API keys and connection strings to make your ColdConvert application work properly.

Overview

Environment variables are configuration values that your application needs to function. In this tutorial, you'll add all the API keys and connection strings you collected in the previous tutorials.

What you'll add
You'll configure database connection, email service API key, Product Hunt API key, and security variables to make your application fully functional.

Step 1: Access Environment Variables

1.Go to your Vercel dashboard
2.Click on your ColdConvert project
3.Go to "Settings" tab
4.Click "Environment Variables" in the left sidebar
Environment Variables Section
You'll see a form where you can add key-value pairs. Each variable you add will be available to your application at runtime.

Step 2: Add Database Variables

Add your database connection strings from the database setup tutorial:

Database Environment Variables
# Add these two variables:

POSTGRES_PRISMA_URL=your-database-connection-string
POSTGRES_URL_NON_POOLING=your-database-connection-string

# Example (replace with your actual connection string):
POSTGRES_PRISMA_URL=postgresql://username:password@host:port/database
POSTGRES_URL_NON_POOLING=postgresql://username:password@host:port/database
1.Click "Add New" in the Environment Variables section
2.Add POSTGRES_PRISMA_URL as the key
3.Paste your database connection string as the value
4.Repeat for POSTGRES_URL_NON_POOLING
5.Click "Save" for each variable
Connection String Format
Make sure your connection string includes the database name at the end. It should look like:postgresql://username:password@host:port/database_name

Step 3: Add Email Variables

Add your Resend API key and email configuration from the email setup tutorial:

Email Environment Variables
# Add these variables:

RESEND_API_KEY=your-resend-api-key
RESEND_FROM_ADMIN=Your Name <support@yourdomain.com>
EMAILS_PER_RUN=5
EMAIL_DOMAIN=yourdomain.com

# Example (replace with your actual values):
RESEND_API_KEY=re_1234567890abcdef...
RESEND_FROM_ADMIN=Sergiu <support@yourdomain.com>
EMAILS_PER_RUN=5
EMAIL_DOMAIN=yourdomain.com
1.Click "Add New" again
2.Add RESEND_API_KEY as the key
3.Paste your Resend API key as the value
4.Click "Save"
5.Add RESEND_FROM_ADMIN with your sender name and email
6.Add EMAILS_PER_RUN with the number of emails to send per cron job run
7.Add EMAIL_DOMAIN with your email domain
API Key Format
Your Resend API key should start with "re_" followed by a long string of characters. Make sure you copy the entire key without any extra spaces.
Email Configuration
  • RESEND_FROM_ADMIN - The sender name and email that will appear in your cold emails
  • EMAILS_PER_RUN - Number of emails sent per cron job execution (recommended: 5-10)
  • EMAIL_DOMAIN - Your email domain for proper authentication

Step 4: Add Product Hunt Variables

Add your Product Hunt API key and configuration from the Product Hunt API tutorial:

Product Hunt Environment Variables
# Add these variables:

PH_API_TOKEN=your-product-hunt-api-token
PH_ENDPOINT_URL=https://api.producthunt.com/v2/api/graphql
TOPICS=saas,productivity,development,ai,startup

# Example (replace with your actual values):
PH_API_TOKEN=phc_1234567890abcdef...
PH_ENDPOINT_URL=https://api.producthunt.com/v2/api/graphql
TOPICS=saas,productivity,development,ai,startup
1.Click "Add New" again
2.Add PH_API_TOKEN as the key
3.Paste your Product Hunt API token as the value
4.Click "Save"
5.Add PH_ENDPOINT_URL with value https://api.producthunt.com/v2/api/graphql
6.Add TOPICS with your selected niches (comma-separated)
Topics Configuration
The TOPICS variable defines which Product Hunt categories to monitor for leads. Available topics include:
  • saas - Software as a Service products
  • productivity - Productivity tools and apps
  • development - Developer tools and software
  • ai - Artificial Intelligence products
  • startup - Startup and business tools
You can customize this list based on your target audience.

Step 5: Add Client Information Variables

Add your personal and business information that will appear in email templates:

Client Information Environment Variables
# Add these variables:

YOUR_NAME=Your Name
YOUR_STARTUP_NAME=Your Startup Name
YOUR_WEBSITE=https://yourwebsite.com

# Example (replace with your actual values):
YOUR_NAME=Sergiu
YOUR_STARTUP_NAME=ColdConvert
YOUR_WEBSITE=https://www.coldconvert.ai
1.Click "Add New" again
2.Add YOUR_NAME with your full name
3.Add YOUR_STARTUP_NAME with your business name
4.Add YOUR_WEBSITE with your website URL
5.Click "Save" for each variable
Email Template Variables
These variables will be used in your cold email templates to personalize your outreach. Make sure the information is accurate and professional as it will appear in emails sent to potential leads.

Step 6: Redeploy

After adding all environment variables, you need to redeploy your application:

1.Go to the "Deployments" tab in your Vercel project
2.Click "Redeploy" on your latest deployment
3.Wait for the deployment to complete
4.Check that the deployment succeeds this time

Success Indicators:

  • Deployment completes successfully
  • No environment variable errors
  • • Your app URL loads without errors
  • • Database connection works properly
Environment Variables Configured
Your application should now deploy successfully with all the required environment variables configured. The next tutorial will help you verify everything is working correctly.

Next Tutorial

Verify Cron Jobs

Now let's verify that your cron jobs are properly configured and ready to automate your cold email campaigns.