Skip to content

Gateway Configuration

The Gateway is Clawdbot’s central routing system that manages message flow between channels and Claude.

.env
# Gateway settings
GATEWAY_ENABLED=true
GATEWAY_PORT=8080
GATEWAY_HOST=0.0.0.0
# Webhooks
WEBHOOK_SECRET=your_secret_key
WEBHOOK_PATH=/webhook
# Rate limiting
RATE_LIMIT_ENABLED=true
RATE_LIMIT_REQUESTS=60
RATE_LIMIT_WINDOW=60

For channels that use webhooks (Telegram, Slack):

config.yaml
gateway:
webhooks:
telegram:
path: /webhook/telegram
secret: ${TELEGRAM_WEBHOOK_SECRET}
slack:
path: /webhook/slack
signing_secret: ${SLACK_SIGNING_SECRET}

For production webhooks, use HTTPS:

Terminal window
# Using reverse proxy (recommended)
# Configure nginx/Caddy to terminate SSL
# Or direct SSL
GATEWAY_SSL_CERT=/path/to/cert.pem
GATEWAY_SSL_KEY=/path/to/key.pem

Add middleware for processing:

@gateway.middleware
async def logging_middleware(request, next):
logger.info(f"Request: {request.path}")
response = await next(request)
return response