Hoox Docs

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

VariableTypeWorkersDescription
INTERNAL_KEY_BINDINGSecrettelegram-worker, hoox, trade-workerInternal authentication key for worker-to-worker communication
TG_BOT_TOKEN_BINDINGSecrettelegram-workerTelegram Bot API token
TG_CHAT_ID_BINDINGSecrettelegram-workerTelegram chat ID for notifications
TELEGRAM_SECRET_TOKENSecrettelegram-workerWebhook verification token for Telegram
WEBHOOK_API_KEY_BINDINGSecrethooxAPI key for webhook endpoints
WALLET_PK_SECRETSecretweb3-wallet-workerPrivate key for Web3 wallet operations
WALLET_MNEMONIC_SECRETSecretweb3-wallet-workerMnemonic phrase for wallet generation
MEXC_KEY_BINDINGSecrettrade-workerMEXC exchange API key
MEXC_SECRET_BINDINGSecrettrade-workerMEXC exchange API secret
BINANCE_KEY_BINDINGSecrettrade-workerBinance exchange API key
BINANCE_SECRET_BINDINGSecrettrade-workerBinance exchange API secret
BYBIT_KEY_BINDINGSecrettrade-workerBybit exchange API key
BYBIT_SECRET_BINDINGSecrettrade-workerBybit exchange API secret
CLOUDFLARE_API_TOKENSecretanalytics-workerCF API token for Analytics SQL queries

Service Bindings

BindingWorkerConnected ServiceDescription
TRADE_SERVICEhoox, agent-worker, email-workertrade-workerAccess to trading functionality
TELEGRAM_SERVICEhoox, trade-worker, agent-worker, web3-wallet-worker, report-workertelegram-workerTelegram notifications
D1_SERVICEtrade-worker, agent-worker, report-worker, dashboardd1-workerCentralized D1 database service
AGENT_SERVICEdashboardagent-workerAgent worker access

KV Namespace Bindings

BindingWorkerDescription
CONFIG_KVhoox, trade-worker, agent-worker, telegram-worker, d1-worker, email-worker, dashboardConfiguration + rate limiter state
SESSIONS_KVhooxWebhook session storage

R2 Bucket Bindings

BindingWorkerBucket NameDescription
UPLOADS_BUCKETtelegram-workeruser-uploadsStore user uploaded files
REPORTS_BUCKETtrade-workertrade-reportsStore trading reports and data

D1 Database Bindings

BindingWorkerDatabase NameDescription
DBd1-workertrade-data-dbMain database for trading data
DBtrade-workertrade-data-dbDatabase for trade operations
DBagent-workertrade-data-dbPortfolio queries

AI Bindings

BindingWorkerDescription
AIhoox, agent-worker, telegram-worker, dashboardAccess to Cloudflare® Workers AI capabilities

Vectorize Bindings

BindingWorkerIndex NameDescription
VECTORIZE_INDEXhoox, telegram-workermy-rag-indexVector database for RAG applications

Analytics Engine Bindings

BindingWorkerDatasetDescription
ANALYTICS_ENGINEanalytics-workerhoox-analyticsTime-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:

ServiceLocal URLUsed By
hoox (Gateway)http://localhost:8787Webhook clients
Trade Workerhttp://localhost:8789hoox, agent-worker, email-worker
Telegram Workerhttp://localhost:8791hoox, trade-worker, agent-worker, web3-wallet, report
d1-workerhttp://localhost:8792trade-worker, agent-worker, report, dashboard
Web3 Wallet Workerhttp://localhost:8793trade-worker
dashboardhttp://localhost:8794Users (browser)
agent-workerhttp://localhost:8795dashboard
email-workerhttp://localhost:8796— (cron triggered)
report-workerhttp://localhost:8797— (cron triggered)

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.