Skip to main content
Environment variables are used to configure sensitive data and environment-specific settings without hardcoding them into your application.

Overview

Dzaleka Online Services uses environment variables for:
  • Email service configuration (Resend API)
  • Deployment adapter selection
  • SSL/TLS certificates (optional)
  • Server configuration

Required Variables

These environment variables are required for full functionality:

RESEND_API_KEY

Required for: Email notifications from Netlify functions Used in:
  • netlify/functions/submit-voice.ts:4
  • netlify/functions/submit-store.ts:4
  • netlify/functions/submit-marketplace.ts:4
  • netlify/functions/submit-course.ts:4
  • netlify/functions/send-feedback-confirmation.ts:4
  • netlify/functions/send-booking-confirmation.ts:4
Description: API key for Resend email service, used to send submission notifications and confirmations. How to obtain:
  1. Sign up for a Resend account at https://resend.com
  2. Navigate to API Keys in your dashboard
  3. Create a new API key
  4. Copy the key (it will only be shown once)

Optional Variables

These variables are optional and provide additional functionality:

NETLIFY

Used in: astro.config.mjs:15 Description: Automatically set by Netlify during deployment. When present, the Netlify adapter is used instead of the Node.js adapter.
You don’t need to set this manually. Netlify automatically provides this variable during builds.

PORT

Used in: dist/server/entry.mjs:1317 Description: Port number for the production server when using Node.js adapter. Defaults to 8080 if not specified.

HOST

Used in: dist/server/entry.mjs:1321 Description: Host address for the production server when using Node.js adapter.

SERVER_CERT_PATH & SERVER_KEY_PATH

Used in: dist/server/entry.mjs:1261,1264,1265 Description: Paths to SSL/TLS certificate and key files for HTTPS support in standalone Node.js mode.
These are only needed for self-hosted deployments with HTTPS. Netlify handles SSL automatically.

ASTRO_NODE_AUTOSTART

Used in: dist/server/entry.mjs:1361 Description: Controls whether the Node.js server starts automatically. Set to disabled to prevent auto-start.

Example .env File

Create a .env file in the root directory:
.env

Setting Environment Variables in Netlify

For production deployments on Netlify:
Changes to environment variables in Netlify don’t automatically trigger a rebuild. You need to manually redeploy.

Security Best Practices

Never commit .env files to version control!
Follow these security practices:
  1. Add .env to .gitignore:
    .gitignore
  2. Use .env.example for documentation: Create a template file without sensitive values:
    .env.example
  3. Rotate keys regularly: Change API keys periodically and after any suspected compromise
  4. Use different keys for development and production: Never use production API keys in development
  5. Limit key permissions: Use API keys with minimum required permissions

Validation

The Netlify functions include basic validation. If RESEND_API_KEY is missing, email sending will fail but won’t crash the function:
Check your Netlify function logs to verify emails are being sent successfully.

Next Steps

Netlify Deployment

Learn how to configure environment variables in Netlify

Configuration

Explore Astro and Tailwind configuration options