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:4netlify/functions/submit-store.ts:4netlify/functions/submit-marketplace.ts:4netlify/functions/submit-course.ts:4netlify/functions/send-feedback-confirmation.ts:4netlify/functions/send-booking-confirmation.ts:4
- Sign up for a Resend account at https://resend.com
- Navigate to API Keys in your dashboard
- Create a new API key
- 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.
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:RESEND_API_KEYre_)Changes to environment variables in Netlify don’t automatically trigger a rebuild. You need to manually redeploy.
Security Best Practices
Follow these security practices:-
Add
.envto.gitignore:.gitignore -
Use
.env.examplefor documentation: Create a template file without sensitive values:.env.example - Rotate keys regularly: Change API keys periodically and after any suspected compromise
- Use different keys for development and production: Never use production API keys in development
- Limit key permissions: Use API keys with minimum required permissions
Validation
The Netlify functions include basic validation. IfRESEND_API_KEY is missing, email sending will fail but won’t crash the function: