{"id":48958060,"url":"https://github.com/barnumbirr/plausible-cf-worker","last_synced_at":"2026-04-18T00:33:30.181Z","repository":{"id":351082443,"uuid":"1176701129","full_name":"barnumbirr/plausible-cf-worker","owner":"barnumbirr","description":"Cloudflare Worker proxy for Plausible Analytics — first-party, multi-site, adblocker-resistant","archived":false,"fork":false,"pushed_at":"2026-04-13T13:55:51.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-13T15:32:01.447Z","etag":null,"topics":["analytics","cloudflare-workers","plausible-analytics","privacy","proxy"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/barnumbirr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"barnumbirr"}},"created_at":"2026-03-09T09:36:48.000Z","updated_at":"2026-04-13T13:53:37.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/barnumbirr/plausible-cf-worker","commit_stats":null,"previous_names":["barnumbirr/plausible-cf-worker"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/barnumbirr/plausible-cf-worker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barnumbirr%2Fplausible-cf-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barnumbirr%2Fplausible-cf-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barnumbirr%2Fplausible-cf-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barnumbirr%2Fplausible-cf-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barnumbirr","download_url":"https://codeload.github.com/barnumbirr/plausible-cf-worker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barnumbirr%2Fplausible-cf-worker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31951426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","cloudflare-workers","plausible-analytics","privacy","proxy"],"created_at":"2026-04-18T00:33:29.357Z","updated_at":"2026-04-18T00:33:30.167Z","avatar_url":"https://github.com/barnumbirr.png","language":"JavaScript","funding_links":["https://github.com/sponsors/barnumbirr"],"categories":[],"sub_categories":[],"readme":"# plausible-cf-worker\n\nCloudflare Worker that proxies [Plausible Analytics](https://plausible.io) as a first-party connection, preventing adblocker interference. Supports multiple domains from a single worker.\n\nBased on [Plausible's Cloudflare proxy guide](https://plausible.io/docs/proxy/guides/cloudflare).\n\n## How it works\n\nThe worker intercepts two paths on your domain:\n\n| Path | Action |\n|------|--------|\n| `/zk/js/script.js` | Serves the Plausible JS (cached at the edge) |\n| `/zk/api/event` | Forwards analytics events to `plausible.io/api/event` |\n\nThe per-site Plausible script URL is resolved from the `PLAUSIBLE` variable in `wrangler.toml` using the request's `Host` header.\n\n## Setup\n\n### 1. Deploy the worker\n\n```bash\nnpm install\nnpx wrangler deploy\n```\n\n### 2. Add a site\n\nIn `wrangler.toml`:\n\n1. Add the hostname and Plausible script URL (from Site Installation settings in Plausible) under `[vars.PLAUSIBLE]`:\n\n    ```toml\n    [vars.PLAUSIBLE]\n    \"example.com\" = \"https://plausible.io/js/pa-XXXXX.js\"\n    ```\n\n2. Add a `[[routes]]` entry:\n\n    ```toml\n    [[routes]]\n    pattern = \"*example.com/zk/*\"\n    zone_name = \"example.com\"\n    ```\n\n3. Redeploy with `npx wrangler deploy`.\n\n### 3. Update your site's script tag\n\n```html\n\u003cscript defer src=\"/zk/js/script.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  window.plausible=window.plausible||function(){(plausible.q=plausible.q||[]).push(arguments)},plausible.init=plausible.init||function(i){plausible.o=i||{}};\n  plausible.init({ endpoint: \"/zk/api/event\" })\n\u003c/script\u003e\n```\n\n## Required secrets\n\n| Secret | Where | Description |\n|--------|-------|-------------|\n| `CLOUDFLARE_API_TOKEN` | GitHub repo secret | API token with Workers deploy permission (for CI) |\n\n## License\n\n```\nCopyright 2026 Martin Simon\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\n```\n\n## Buy me a coffee?\n\nIf you feel like buying me a coffee (or a beer?), donations are welcome:\n\n```\nBTC : bc1qq04jnuqqavpccfptmddqjkg7cuspy3new4sxq9\nDOGE: DRBkryyau5CMxpBzVmrBAjK6dVdMZSBsuS\nETH : 0x2238A11856428b72E80D70Be8666729497059d95\nLTC : MQwXsBrArLRHQzwQZAjJPNrxGS1uNDDKX6\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarnumbirr%2Fplausible-cf-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarnumbirr%2Fplausible-cf-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarnumbirr%2Fplausible-cf-worker/lists"}