Environment Variables Reference
Relevant source files
The following files were used as context for generating this wiki page:
Environment variables in the Send Again platform serve as the primary configuration mechanism for infrastructure integration, feature enablement, and operational scaling. The application relies on these variables to establish secure connections with core service providers, including Amazon SES for email delivery and Supabase for authentication and database management.
Configuration is typically managed via a .env.local file for development or through environment-specific secret managers in production. While some variables are strictly required for the application to function, many are optional and enable advanced features such as AI-assisted content generation, automated DNS management, and credit-based billing.
Sources: README.md:101-103, src/app/privacy-policy/page.tsx:50-55
Core Infrastructure
The application requires connectivity to AWS for email infrastructure and Supabase for the backend data layer. Without these variables, the application will fail to authenticate or process email sends.
AWS SES Configuration
Send Again uses Amazon SES for high-deliverability email transmission. These variables define the IAM credentials and the geographic region used for the SES API calls.
| Variable | Required | Default | Description |
|---|---|---|---|
AWS_ACCESS_KEY_ID | Yes | — | AWS IAM access key with SES permissions |
AWS_SECRET_ACCESS_KEY | Yes | — | AWS IAM secret key |
AWS_REGION | No | eu-west-3 | AWS region for SES operations |
Sources: README.md:105-107, README.md:151-153
Supabase Integration
Supabase provides the PostgreSQL database and authentication services. The application uses both a publishable key for client-side interactions and a secret key for elevated server-side operations.
| Variable | Required | Default | Description |
|---|---|---|---|
SUPABASE_URL | Yes | — | The project URL for the Supabase instance |
SUPABASE_PUBLISHABLE_KEY | Yes | — | Public key for client-side Supabase SDK |
SUPABASE_SECRET_KEY | Yes | — | Service role secret key for server-side DB access |
Sources: README.md:108-110, README.md:154-156
Feature-Specific Configuration
AI Compose (OpenAI)
The "AI Compose" feature uses OpenAI to generate HTML email content based on user instructions. The system prompt and model selection are controlled through these variables.
The diagram above shows how the OPENAI_API_KEY is checked within the vibe generation route to enable the feature.
| Variable | Required | Default | Description |
|---|---|---|---|
OPENAI_API_KEY | No | — | Enables AI email generation features |
OPENAI_MODEL | No | gpt-4.1-mini | The specific OpenAI model used for generation |
Sources: src/app/api/vibe/route.ts:140-149, README.md:159-160
DNS Automation
To simplify domain verification (SPF/DKIM/DMARC), Send Again integrates with various DNS providers. These variables provide the necessary API credentials to automate the creation of DNS records.
| Provider | Variable | Description |
|---|---|---|
| Namecheap | NAMECHEAP_API_KEY | API Key for DNS record management |
NAMECHEAP_API_USER | Authorized API user | |
NAMECHEAP_CLIENT_IP | Whitelisted IPv4 address required by Namecheap | |
| Cloudflare | CLOUDFLARE_API_TOKEN | Token with Zone:Read and DNS:Edit permissions |
CLOUDFLARE_ZONE_ID | Optional specific zone identifier | |
| Route53 | ROUTE53_HOSTED_ZONE_ID | Optional specific hosted zone ID |
Sources: src/app/api/workspaces/setup/route.ts:58-71, README.md:163-171
Send Job Worker Settings
Processing high-volume email campaigns requires a job worker. The following variables control the performance, batching, and security of the POST /api/send/process endpoint.
The worker orchestration relies on tokens and batch limits defined in the environment.
| Variable | Required | Default | Description |
|---|---|---|---|
SEND_JOB_PROCESSOR_TOKEN | No | — | Shared secret for securing the worker endpoint |
SEND_JOB_BATCH_SIZE | No | 50 | Number of recipients processed per batch |
SEND_JOB_CONCURRENCY | No | 4 | Number of parallel sends per batch |
SEND_JOB_MAX_RECIPIENTS_PER_JOB | No | 250 | Maximum recipients per processor invocation |
Sources: README.md:130-134, README.md:172-177
Billing and Credits (Polar)
Send Again supports an optional credit-based billing system via Polar. When BILLING_ENFORCED is set to true, the system checks for sufficient credits before allowing a send job to proceed.
| Variable | Default | Description |
|---|---|---|
BILLING_ENFORCED | false | Enables credit enforcement for email sends |
FREE_TIER_INITIAL_CREDITS | 1000 | Credits granted to new workspaces |
POLAR_ACCESS_TOKEN | — | Integration token for the Polar platform |
POLAR_SERVER | sandbox | Polar environment (sandbox or production) |
POLAR_CREDIT_PACKS_JSON | — | JSON array defining purchasable credit packs |
POLAR_WEBHOOK_SECRET | — | Secret used to verify incoming Polar webhooks |
Sources: README.md:139-145, README.md:184-194
Security and Identity
Operational security is managed through secrets used for link signing and access control for the bootstrap account.
UNSUBSCRIBE_SECRET: Used for signing unsubscribe links to prevent tampering. If omitted, the system defaults to theSUPABASE_SECRET_KEY.INITIAL_OWNER_EMAIL: Identifies the bootstrap owner account during initial setup.ALLOWED_AUTH_EMAILS: A comma-separated list of emails permitted to sign in (defaults to the initial owner).APP_BASE_URL: The public-facing URL of the application, used to construct absolute URLs for unsubscribe links.
Sources: README.md:113-115, README.md:157-158, README.md:161-162
Summary
Environment variables in Send Again allow for a highly modular deployment. By configuring the required AWS and Supabase variables, developers can establish a functional baseline, while the optional variables for AI, DNS, and Billing provide the flexibility to scale the platform from a simple internal tool to a multi-tenant cloud service. All significant logic, from vibe generation to DNS automation, is gated by the presence and validity of these configurations.