process.env mechanism works exactly as you would expect — any environment variable set for the container is available to your code at runtime. This is how you pass API keys, webhook URLs, and other configuration without embedding them directly in your source.
Setting environment variables
Configure environment variables for your agent through the DolphinClaw dashboard:Add your variables
Under the Environment Variables section, add each key-value pair. Values are stored as secrets and are never exposed in the dashboard UI after saving.
Accessing variables in code
Read environment variables withprocess.env.YOUR_VARIABLE_NAME. The value is always a string (or undefined if the variable was not set).
|| operator, as shown in the official Groq Discord Agent example:
process.env.OPENAI_API_KEY resolves to the secret you configured in the dashboard. The fallback string is only used when you run the file locally without the variable set.
Common variables to configure through the dashboard include API keys for external services (OpenAI, Groq, etc.), webhook URLs for notification endpoints (Discord, Slack, etc.), and any configuration flags that may differ between test and production runs.