Skip to content

Make Analytics Engine optional for free-tier hosting#1

Open
buren wants to merge 1 commit intomainfrom
make-analytics-optional
Open

Make Analytics Engine optional for free-tier hosting#1
buren wants to merge 1 commit intomainfrom
make-analytics-optional

Conversation

@buren
Copy link
Copy Markdown
Owner

@buren buren commented Apr 3, 2026

Summary

Analytics Engine requires the Cloudflare Workers Paid plan ($5/mo). This PR makes it fully optional so the app can be deployed and run on the free tier — including via the "Deploy to Cloudflare" button.

  • Guard trackLinkRedirect to silently skip when the REDIRECTS binding is absent
  • Remove analytics_engine_datasets from wrangler.jsonc so one-click deploy works on free accounts
  • Add REDIRECTS? to the Env type so the code compiles with or without the binding
  • Update README: mark analytics as optional, change ANALYTICS_API_TOKEN/ACCOUNT_ID to non-required, add "Enabling Analytics" section with opt-in instructions

The stats API endpoint and Slack /ishere stats command were already guarded — they return "not configured" when the analytics secrets are missing.

Test plan

  • New unit test: trackLinkRedirect silently returns when REDIRECTS is undefined (no errors logged)
  • All 229 existing tests pass
  • Pre-existing TS type errors unchanged (not introduced by this PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant