Overview
rearjackman requires environment variables for authentication and service configuration. Secrets are managed via Wrangler and injected into the worker at runtime.Required secrets
SYNC_SECRET
Authentication secret for manual sync API requests. Type:string
Usage: Protects the /api/sync/:season endpoint from unauthorized access.
Using the sync endpoint
OnceSYNC_SECRET is set, trigger manual syncs with:
from- Starting round number (default: 1)to- Ending round number (default: all rounds)
The sync endpoint queues jobs to
SYNC_QUEUE for asynchronous processing. See src/worker.ts:122-151 for implementation details.Local development
For local development, create a.dev.vars file in the project root:
.dev.vars when running npm run dev.
Local sync example
Thepackage.json includes a convenience script for local testing:
Environment bindings
The worker environment interface is defined insrc/types.ts:
Accessing environment variables
All environment variables and bindings are accessed via theenv parameter:
Production secrets management
List all secrets in production:Secret updates take effect immediately. No redeployment required.
Security best practices
- Use strong secrets: Generate cryptographically secure random strings for
SYNC_SECRET - Rotate regularly: Update secrets periodically
- Never log secrets: Avoid logging
SYNC_SECRETor other sensitive values - Separate environments: Use different secrets for development and production
- Limit access: Only share secrets with authorized team members
Generating secure secrets
Next steps
- Deploy to Cloudflare Workers
- Learn about Wrangler secrets
- Review environment variable best practices