Environment Overview
Pulse Content uses environment variables to configure:- External service credentials (Sanity, Pinecone, Kie.ai)
- API keys for AI providers
- Authentication secrets
- Feature flags and service URLs
Environment Files
Local Development (.dev.vars)
Create.dev.vars in project root (gitignored):
Production (Cloudflare Pages)
Set via Cloudflare dashboard or Wrangler CLI: Dashboard: Workers & Pages > pulse-content > Settings > Environment Variables CLI:Required Variables
Sanity CMS
Project ID from sanity.io/manage
Dataset name (typically
production)API token with Editor role for write accessGenerate:
- Go to sanity.io/manage
- Select project > API > Tokens
- Add token with Editor permissions
AI Services
Claude API key for content generationGet key: console.anthropic.com
OpenRouter API key for multi-model accessGet key: openrouter.ai/keys
Vector Database
Pinecone API key for RAG (design templates, brand guidelines)Get key: app.pinecone.io > API Keys
Full Pinecone host URLFormat:
https://your-index.svc.region.pinecone.ioFind: Pinecone dashboard > Indexes > your-index > ConnectionImage Generation
Kie.ai API key for Nano Banana Pro image generationGet key: kie.ai dashboard
Data Scraping
RapidAPI key for LinkedIn profile scrapingGet key: rapidapi.com > My Apps
Authentication
Secret key for signing JWT tokens (minimum 32 bytes)Generate:
Email Service
Resend API key for password reset emailsGet key: resend.com/api-keys
Email address for sending password resetsFormat:
"Pulse Studio <[email protected]>"Base URL of the applicationLocal:
http://localhost:5173Production: https://production.youvebeenheard.comMedia Processing
AssemblyAI API key for video transcriptionGet key: assemblyai.com/dashboard
Base64-encoded Google Cloud service account key JSONSetup:
- Create service account at console.cloud.google.com/iam-admin/serviceaccounts
- Download JSON key file
- Base64 encode:
Optional Variables
YBH Sales Integration
Base URL for YBH Sales API (guest auto-sync)Example:
https://api.youvebeenheard.comShared API key for YBH Sales integrationMust match
WEBHOOK_API_KEY or one of KANBAN_API_KEYS in ybh-sales-platformProtects
/api/ybh/backfill-guests endpointAllows server-to-server auth for
/api/late/* via X-Pulse-Bot-Api-Key headerEnvironment-Specific Configuration
Development vs. Production
| Variable | Development | Production |
|---|---|---|
APP_BASE_URL | http://localhost:5173 | https://production.youvebeenheard.com |
SANITY_DATASET | development or production | production |
| API Keys | Test/sandbox keys | Production keys |
| Logging | Verbose | Error-only |
Feature Flags
Toggle features based on environment:Managing Secrets
Local Development
-
Copy example file:
-
Fill in values:
-
Source automatically when running:
Production (Cloudflare)
- Cloudflare Dashboard
- Wrangler CLI
- GitHub Actions
- Navigate to Workers & Pages
- Select pulse-content project
- Go to Settings > Environment Variables
- Click Add variable
- Choose Encrypt for sensitive values
- Click Save
Accessing Environment Variables
In Cloudflare Workers (Backend)
In Frontend (Client)
Security Best Practices
Rotate Secrets Regularly
Change API keys and tokens periodically (every 3-6 months)
Use Minimum Permissions
Grant only required permissions (e.g., Editor role, not Admin)
Never Commit Secrets
Add
.dev.vars and .env* to .gitignoreSeparate Dev/Prod Keys
Use different API keys for development and production
Validation
Validate environment variables at startup:Next Steps
Cloudflare Deployment
Deploy to Cloudflare Pages
CI/CD Pipeline
Automate deployment with GitHub Actions
Setup Guide
Local development setup
Architecture
System architecture overview