{"id":13692950,"url":"https://github.com/unlock-protocol/cloudflare-worker","last_synced_at":"2025-05-02T20:30:24.423Z","repository":{"id":39570789,"uuid":"251400983","full_name":"unlock-protocol/cloudflare-worker","owner":"unlock-protocol","description":"A cloudflare worker to add a lock to any website!","archived":false,"fork":false,"pushed_at":"2022-03-04T06:36:22.000Z","size":374,"stargazers_count":24,"open_issues_count":3,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-08T21:41:25.077Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unlock-protocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-30T18:59:17.000Z","updated_at":"2024-05-28T02:16:16.000Z","dependencies_parsed_at":"2022-08-29T12:02:08.619Z","dependency_job_id":null,"html_url":"https://github.com/unlock-protocol/cloudflare-worker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unlock-protocol%2Fcloudflare-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unlock-protocol%2Fcloudflare-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unlock-protocol%2Fcloudflare-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unlock-protocol%2Fcloudflare-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unlock-protocol","download_url":"https://codeload.github.com/unlock-protocol/cloudflare-worker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252103825,"owners_count":21695375,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-02T17:01:03.842Z","updated_at":"2025-05-02T20:30:24.112Z","avatar_url":"https://github.com/unlock-protocol.png","language":"JavaScript","funding_links":[],"categories":["Integrations"],"sub_categories":[],"readme":"# 👷 A Cloudflare Worker to lock 🔓 a webpage\n\nA Cloudflare woekr which lets website owners easily deploy an access control layer for monetization with [Unlock](https://unlock-protocol.com).\n\nYou can try it out by going to https://token-gated.com/ which is token gated an requires ownership of a membership (it is using the Rinkeby test network, so you don't need to spend real money).\n\n## How to\n\n### Clone the repo:\n\n```bash\ngit clone git@github.com:unlock-protocol/cloudflare-worker.git\n```\n\n### Configure worker\n\nUpdate its `.src/config.js` file to match your needs. Importantly, you need to keep the `pessimistic` mode to be `true` .\n\n### Install dependencies\n\n```bash\nyarn\n```\n\n### Push to cloudflare\n\n```bash\nyarn wrangler publish\n```\n\n(You will likely be prompted to login to CloudFlare first)\n\n### Configure website\n\nNow that the worker is deployed, you need to link it to your CloudFlare sites. Your mileage may vary but here is howe we did it for https://token-gated.com. From the Cloudflare Dashboard, select your website, in the left column, click on \"Workers\". Click the `Add Route` button. Enter the route(s) you want to \"token-gate\". In the `Service` select, pick the `unlock-cloudflare-worker` and select the environment of choice. Hit `Save`. You're all set!\n\n![Screen Recording 2022-02-05 at 05 38 31 PM](https://user-images.githubusercontent.com/17735/152661436-347c9ccf-a9fb-4d1e-8b3a-817ecfb2a887.gif)\n\n## Contributing\n\nYou are encouraged to open pull-requests and help us improve this worker!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funlock-protocol%2Fcloudflare-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funlock-protocol%2Fcloudflare-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funlock-protocol%2Fcloudflare-worker/lists"}