Cloudflare® Workers Bindings & Environment Variables
This document provides a comprehensive reference for all bindings, environment variables, and secrets used in the Cloudflare® Workers project.
Table of Contents
Secrets & Environment Variables
| Variable | Type | Workers | Description |
|---|
INTERNAL_KEY_BINDING | Secret | telegram-worker, hoox, trade-worker | Internal authentication key for worker-to-worker communication |
TG_BOT_TOKEN_BINDING | Secret | telegram-worker | Telegram Bot API token |
TG_CHAT_ID_BINDING | Secret | telegram-worker | Telegram chat ID for notifications |
TELEGRAM_SECRET_TOKEN | Secret | telegram-worker | Webhook verification token for Telegram |
WEBHOOK_API_KEY_BINDING | Secret | hoox | API key for webhook endpoints |
WALLET_PK_SECRET | Secret | web3-wallet-worker | Private key for Web3 wallet operations |
WALLET_MNEMONIC_SECRET | Secret | web3-wallet-worker | Mnemonic phrase for wallet generation |
MEXC_KEY_BINDING | Secret | trade-worker | MEXC exchange API key |
MEXC_SECRET_BINDING | Secret | trade-worker | MEXC exchange API secret |
BINANCE_KEY_BINDING | Secret | trade-worker | Binance exchange API key |
BINANCE_SECRET_BINDING | Secret | trade-worker | Binance exchange API secret |
BYBIT_KEY_BINDING | Secret | trade-worker | Bybit exchange API key |
BYBIT_SECRET_BINDING | Secret | trade-worker | Bybit exchange API secret |
CLOUDFLARE_API_TOKEN | Secret | analytics-worker | CF API token for Analytics SQL queries |
Service Bindings
| Binding | Worker | Connected Service | Description |
|---|
TRADE_SERVICE | hoox, agent-worker, email-worker | trade-worker | Access to trading functionality |
TELEGRAM_SERVICE | hoox, trade-worker, agent-worker, web3-wallet-worker, report-worker | telegram-worker | Telegram notifications |
D1_SERVICE | trade-worker, agent-worker, report-worker, dashboard | d1-worker | Centralized D1 database service |
AGENT_SERVICE | dashboard | agent-worker | Agent worker access |
KV Namespace Bindings
| Binding | Worker | Description |
|---|
CONFIG_KV | hoox, trade-worker, agent-worker, telegram-worker, d1-worker, email-worker, dashboard | Configuration + rate limiter state |
SESSIONS_KV | hoox | Webhook session storage |
R2 Bucket Bindings
| Binding | Worker | Bucket Name | Description |
|---|
UPLOADS_BUCKET | telegram-worker | user-uploads | Store user uploaded files |
REPORTS_BUCKET | trade-worker | trade-reports | Store trading reports and data |
D1 Database Bindings
| Binding | Worker | Database Name | Description |
|---|
DB | d1-worker | trade-data-db | Main database for trading data |
DB | trade-worker | trade-data-db | Database for trade operations |
DB | agent-worker | trade-data-db | Portfolio queries |
AI Bindings
| Binding | Worker | Description |
|---|
AI | hoox, agent-worker, telegram-worker, dashboard | Access to Cloudflare® Workers AI capabilities |
Vectorize Bindings
| Binding | Worker | Index Name | Description |
|---|
VECTORIZE_INDEX | hoox, telegram-worker | my-rag-index | Vector database for RAG applications |
Analytics Engine Bindings
| Binding | Worker | Dataset | Description |
|---|
ANALYTICS_ENGINE | analytics-worker | hoox-analytics | Time-series metrics from all workers |
Browser Rendering
Report-worker uses the Cloudflare Browser Rendering REST API (no wrangler binding needed):
POST https://api.cloudflare.com/client/v4/accounts/{id}/browser-rendering/pdf
Authorization: Bearer {CF_API_TOKEN}
Body: { html: "...", options: { format: "A4" } }
Local Development URLs
For local development with wrangler dev, the following service URLs are used:
Configuration
Each worker contains a .dev.vars file for local development which should be populated with the appropriate values. These files should not be committed to the repository.
Example setup for .dev.vars files can be found in the corresponding .dev.vars.example files in each worker directory.
Setting Up Secrets
For production deployment, secrets should be set using the Wrangler CLI:
wrangler secret put SECRET_NAME
This will securely store the secret and make it available to the worker at runtime.
Cloudflare® and the Cloudflare logo are trademarks and/or registered trademarks of Cloudflare, Inc. in the United States and other jurisdictions.