{"_id":"@designsystemsinternational/cloudflare-password","_rev":"5-9f9360addb061b7a58951a8f34dbad71","name":"@designsystemsinternational/cloudflare-password","dist-tags":{"latest":"0.0.6"},"versions":{"0.0.1":{"name":"@designsystemsinternational/cloudflare-password","version":"0.0.1","_id":"@designsystemsinternational/cloudflare-password@0.0.1","maintainers":[{"name":"lnolte","email":"hello@lucas-nolte.com"},{"name":"runemadsen","email":"rune@runemadsen.com"},{"name":"bravomartin","email":"bravomartin@gmail.com"},{"name":"ejsandoval","email":"ejsandoval@uc.cl"},{"name":"fdoflorenzano","email":"f.florenzano94@gmail.com"}],"dist":{"shasum":"d3425b9b6038be071e4831cdf80e5cdcfd9d2d42","tarball":"https://registry.npmjs.org/@designsystemsinternational/cloudflare-password/-/cloudflare-password-0.0.1.tgz","fileCount":89,"integrity":"sha512-f59/IKdPeZHkEADlaIr9HjgeR6TjDbGDxd26AG9CK6DYRrgXKi2dxayOLjGyG3HyFx32jz4DQPAypNMxQ5jFOA==","signatures":[{"sig":"MEQCIAfAIcoAqtraFi8TNzq85MVFlIitJAp2uoR7vvLnF9wiAiB8wYMl+PoORNEdBOiMq4KJdUk3KJRAsqfZUWF+CbxXhg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2510743},"type":"module","gitHead":"b5b900f5bda35fdc17a79124b284b270ab3f4ed2","scripts":{"dev":"npm run build && wrangler dev","lint":"eslint .","build":"tsc -b && vite build","deploy":"npm run build && wrangler deploy","cf-typegen":"wrangler types","dev:templates":"vite"},"_npmUser":{"name":"runemadsen","email":"rune@runemadsen.com"},"_npmVersion":"10.9.4","description":"This package can be used to add simple password-based authentication to a static website running on Cloudflare Workers. It does so by injecting a worker script that listens to incoming connections and prompts for a password if a JWT cookie is not set.","directories":{},"_nodeVersion":"22.21.0","dependencies":{"zod":"^4.1.13","react":"^19.1.1","worktop":"^0.7.3","react-dom":"^19.1.1","@tsndr/cloudflare-worker-jwt":"^3.2.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.1.2","eslint":"^9.33.0","globals":"^16.3.0","wrangler":"^4.53.0","@eslint/js":"^9.33.0","typescript":"~5.8.3","@types/node":"^24.10.1","@types/react":"^19.1.10","@types/react-dom":"^19.1.7","typescript-eslint":"^8.39.1","@vitejs/plugin-react":"^5.0.0","@cloudflare/vite-plugin":"^1.17.0","eslint-plugin-react-hooks":"^5.2.0","eslint-plugin-react-refresh":"^0.4.20"},"_npmOperationalInternal":{"tmp":"tmp/cloudflare-password_0.0.1_1765279529398_0.8353414456295816","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@designsystemsinternational/cloudflare-password","version":"0.0.3","_id":"@designsystemsinternational/cloudflare-password@0.0.3","maintainers":[{"name":"lnolte","email":"hello@lucas-nolte.com"},{"name":"runemadsen","email":"rune@runemadsen.com"},{"name":"bravomartin","email":"bravomartin@gmail.com"},{"name":"ejsandoval","email":"ejsandoval@uc.cl"},{"name":"fdoflorenzano","email":"f.florenzano94@gmail.com"}],"dist":{"shasum":"400e1b91fe9aff7bf976cdfeb6dc17b73f34c39a","tarball":"https://registry.npmjs.org/@designsystemsinternational/cloudflare-password/-/cloudflare-password-0.0.3.tgz","fileCount":90,"integrity":"sha512-WqPk+kqYkUdA/4krNenLApjQeRzgdWQHcgukKzoKl8PTAN/JgJ41DmwHwV3rYXu8sJpHxhegqLLD/WmG65g4PQ==","signatures":[{"sig":"MEUCIQD2g5lAsQ0QV0SoTRgA4EChUDZZGl4982u0FOAWPiozYAIgC3O0CVXwWDkUBcANX4sx27/6L5svLUPlCdCgA38cPko=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2511362},"type":"module","gitHead":"acd237748e6b09c4b84e556264612dd946642f77","scripts":{"dev":"npm run build && wrangler dev","lint":"eslint .","build":"tsc -b && vite build","deploy":"npm run build && wrangler deploy","cf-typegen":"wrangler types","dev:templates":"vite"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3333c5a4-85cc-4267-92fa-3b0411666e81"}},"_npmVersion":"11.6.4","description":"This package can be used to add simple password-based authentication to a static website running on Cloudflare Workers. It does so by injecting a worker script that listens to incoming connections and prompts for a password if a JWT cookie is not set.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"zod":"^4.1.13","react":"^19.1.1","worktop":"^0.7.3","react-dom":"^19.1.1","@tsndr/cloudflare-worker-jwt":"^3.2.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.1.2","eslint":"^9.33.0","globals":"^16.3.0","wrangler":"^4.53.0","@eslint/js":"^9.33.0","typescript":"~5.8.3","@types/node":"^24.10.1","@types/react":"^19.1.10","@types/react-dom":"^19.1.7","typescript-eslint":"^8.39.1","@vitejs/plugin-react":"^5.0.0","@cloudflare/vite-plugin":"^1.17.0","eslint-plugin-react-hooks":"^5.2.0","eslint-plugin-react-refresh":"^0.4.20"},"_npmOperationalInternal":{"tmp":"tmp/cloudflare-password_0.0.3_1765280429244_0.031008890896596197","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@designsystemsinternational/cloudflare-password","version":"0.0.5","_id":"@designsystemsinternational/cloudflare-password@0.0.5","maintainers":[{"name":"lnolte","email":"hello@lucas-nolte.com"},{"name":"runemadsen","email":"rune@runemadsen.com"},{"name":"bravomartin","email":"bravomartin@gmail.com"},{"name":"ejsandoval","email":"ejsandoval@uc.cl"},{"name":"fdoflorenzano","email":"f.florenzano94@gmail.com"}],"homepage":"https://github.com/designsystemsinternational/cloudflare-password#readme","bugs":{"url":"https://github.com/designsystemsinternational/cloudflare-password/issues"},"dist":{"shasum":"aa55517d967027a4e1bed73082d94cb15aaf156d","tarball":"https://registry.npmjs.org/@designsystemsinternational/cloudflare-password/-/cloudflare-password-0.0.5.tgz","fileCount":156,"integrity":"sha512-0bEJFOdbWRR5iRryiK/3a9ggK72kooZG2+/qxSYVWu4MpZDu32Hxe9TwDbEg7sb+ho8KOEW3nC8XsEdY0uywOQ==","signatures":[{"sig":"MEUCIEtXhug9p8bRcXkwSgniZQdNHffar78ZAV+6gKxgUcJOAiEAxy4j+UYzJynlV45m3Yc1s8aGJdMW9BVPSt0JLUl9u5Y=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@designsystemsinternational%2fcloudflare-password@0.0.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":4799584},"type":"module","gitHead":"dbd543a9d726ca26a1bf548fdbf11ab4ff7376d0","scripts":{"dev":"npm run build && wrangler dev","lint":"eslint .","build":"tsc -b && vite build","deploy":"npm run build && wrangler deploy","cf-typegen":"wrangler types","dev:templates":"vite"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3333c5a4-85cc-4267-92fa-3b0411666e81"}},"repository":{"url":"git+https://github.com/designsystemsinternational/cloudflare-password.git","type":"git"},"_npmVersion":"11.6.4","description":"This package can be used to add simple password-based authentication to a static website running on Cloudflare Workers. It does so by injecting a worker script that listens to incoming connections and prompts for a password if a JWT cookie is not set.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"zod":"^4.1.13","react":"^19.1.1","worktop":"^0.7.3","react-dom":"^19.1.1","@tsndr/cloudflare-worker-jwt":"^3.2.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.1.2","eslint":"^9.33.0","globals":"^16.3.0","wrangler":"^4.53.0","@eslint/js":"^9.33.0","typescript":"~5.8.3","@types/node":"^24.10.1","@types/react":"^19.1.10","@types/react-dom":"^19.1.7","typescript-eslint":"^8.39.1","@vitejs/plugin-react":"^5.0.0","@cloudflare/vite-plugin":"^1.17.0","eslint-plugin-react-hooks":"^5.2.0","eslint-plugin-react-refresh":"^0.4.20"},"_npmOperationalInternal":{"tmp":"tmp/cloudflare-password_0.0.5_1765283047681_0.022626572262933964","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"@designsystemsinternational/cloudflare-password","version":"0.0.6","_id":"@designsystemsinternational/cloudflare-password@0.0.6","maintainers":[{"name":"lnolte","email":"hello@lucas-nolte.com"},{"name":"runemadsen","email":"rune@runemadsen.com"},{"name":"bravomartin","email":"bravomartin@gmail.com"},{"name":"ejsandoval","email":"ejsandoval@uc.cl"},{"name":"fdoflorenzano","email":"f.florenzano94@gmail.com"}],"homepage":"https://github.com/designsystemsinternational/cloudflare-password#readme","bugs":{"url":"https://github.com/designsystemsinternational/cloudflare-password/issues"},"dist":{"shasum":"aa35b08770f0b8ebec6e32c7af3c8dac4237333a","tarball":"https://registry.npmjs.org/@designsystemsinternational/cloudflare-password/-/cloudflare-password-0.0.6.tgz","fileCount":41,"integrity":"sha512-vyA1MU/l6KVO2mRkL7D6ofttF8qKaA2Jnlr0pgdzz5vcRvDkRBfTzFWGOi0Lws901Vyxat0Dh5pGFDkKe9AYyg==","signatures":[{"sig":"MEUCID+TM6tniII6yUW+39d0ZcNCYAh2wQAPFZzQ5n6P94MrAiEA6fonc/OvJHi0CT/DLkM4Kv7m61GTq+GMilBiiAS0X+w=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@designsystemsinternational%2fcloudflare-password@0.0.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":838793},"type":"module","gitHead":"9b8c7cda7921be3c605541e0a3dc0f9a813dc29c","scripts":{"dev":"npm run build && wrangler dev","lint":"eslint .","build":"tsc -b && vite build","deploy":"npm run build && wrangler deploy","cf-typegen":"wrangler types","dev:templates":"vite"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3333c5a4-85cc-4267-92fa-3b0411666e81"}},"repository":{"url":"git+https://github.com/designsystemsinternational/cloudflare-password.git","type":"git"},"_npmVersion":"11.6.4","description":"This package can be used to add simple password-based authentication to a static website running on Cloudflare Workers. It does so by injecting a worker script that listens to incoming connections and prompts for a password if a JWT cookie is not set.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"zod":"^4.1.13","clsx":"^2.1.1","react":"^19.1.1","worktop":"^0.7.3","react-dom":"^19.1.1","@cassiozen/usestatemachine":"^1.0.1","@tsndr/cloudflare-worker-jwt":"^3.2.0"},"_hasShrinkwrap":false,"devDependencies":{"vite":"^7.1.2","eslint":"^9.33.0","globals":"^16.3.0","postcss":"^8.5.6","wrangler":"^4.53.0","@eslint/js":"^9.33.0","typescript":"~5.8.3","@types/node":"^24.10.1","@types/react":"^19.1.10","@types/react-dom":"^19.1.7","typescript-eslint":"^8.39.1","postcss-preset-env":"^10.3.1","@vitejs/plugin-react":"^5.0.0","@cloudflare/vite-plugin":"^1.17.0","@lehoczky/postcss-fluid":"^1.0.3","eslint-plugin-react-hooks":"^5.2.0","eslint-plugin-react-refresh":"^0.4.20","@csstools/postcss-global-data":"^3.1.0"},"_npmOperationalInternal":{"tmp":"tmp/cloudflare-password_0.0.6_1765288357089_0.10506690765980675","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-12-09T11:25:29.297Z","modified":"2026-01-29T16:51:36.422Z","0.0.1":"2025-12-09T11:25:29.637Z","0.0.3":"2025-12-09T11:40:29.466Z","0.0.5":"2025-12-09T12:24:07.979Z","0.0.6":"2025-12-09T13:52:37.273Z"},"bugs":{"url":"https://github.com/designsystemsinternational/cloudflare-password/issues"},"homepage":"https://github.com/designsystemsinternational/cloudflare-password#readme","repository":{"url":"git+https://github.com/designsystemsinternational/cloudflare-password.git","type":"git"},"description":"This package can be used to add simple password-based authentication to a static website running on Cloudflare Workers. It does so by injecting a worker script that listens to incoming connections and prompts for a password if a JWT cookie is not set.","maintainers":[{"email":"hello@lucas-nolte.com","name":"lnolte"},{"email":"rune@runemadsen.com","name":"runemadsen"},{"email":"bravomartin@gmail.com","name":"bravomartin"},{"email":"ejsandoval@uc.cl","name":"ejsandoval"},{"email":"f.florenzano94@gmail.com","name":"fdoflorenzano"},{"email":"aldo.medina.z@gmail.com","name":"aldomedina"}],"readme":"# DSI Cloudflare Password\n\nThis package can be used to add simple password-based authentication to a static\nwebsite running on Cloudflare Workers. It does so by injecting a worker script\nthat listens to incoming connections and prompts for a password if a JWT cookie\nis not set.\n\n## Usage\n\n### How to password protect a site\n\nIn your static site repo, install this package:\n\n```bash\nnpm i @designsystemsinternational/cloudflare-password\n```\n\nThen, add the following two environment variables in Cloudflare Workers and set\nit to the desired values.\n\n```\nSECRET=supersecret\nPASSWORD=something\n```\n\nThen, make sure that your build process copies the auth templates into an `auth`\nfolder in your build output. Here's an example of what this looks like for a\nVite site:\n\n```json\n{\n  \"scripts\": {\n    \"build\": \"vite build && cp -r node_modules/@designsystemsinternational/cloudflare-password/dist/auth dist/auth/\"\n  }\n}\n```\n\nThen, add the following to your `wrangler.jsonc` file, on top of your existing\nconfig for the static site.\n\n```jsonc\n{\n  // This makes sure that the worker runs as a part of the deployment\n  \"main\": \"./node_modules/@designsystemsinternational/cloudflare-password/worker/index.ts\",\n  \"assets\": {\n    // This is needed because the binding is hard coded in the worker\n    \"binding\": \"ASSETS\",\n    // This makes sure that the worker runs before serving static assets\n    // Can use array of globs to only protect certain files\n    \"run_worker_first\": true\n  }\n}\n```\n\n## Development\n\n### Local development\n\nBecause of the way Cloudflare workers operate, it's hard to have a single local\ndevelopment command to test the entire flow while preserving the Vite hot module\nreloading. So, the development scripts are divided into two:\n\n- `npm run dev` runs the cloudflare worker in a local environment that matches\n  the production environment. With this, you can test the entire login flow, but\n  the auth templates will use `vite build` and not run via hot module reloading.\n- `npm run dev:templates` will run the Vite dev server, so it's possible to\n  design the templates with hot module reloading. The worker won't run, so the\n  actual login won't work.\n\nAll you need is to add a `.env.local` file with the required environment\nvariables above.\n","readmeFilename":"README.md"}