{"id":17675843,"url":"https://github.com/hormesiel/vercel-basic-auth","last_synced_at":"2025-04-05T20:08:26.729Z","repository":{"id":42664950,"uuid":"166860005","full_name":"hormesiel/vercel-basic-auth","owner":"hormesiel","description":"How to add BASIC AUTHENTICATION to a VERCEL deployment for FREE using various techniques.","archived":false,"fork":false,"pushed_at":"2024-11-20T16:15:56.000Z","size":642,"stargazers_count":107,"open_issues_count":1,"forks_count":15,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T19:07:10.736Z","etag":null,"topics":["authentication","basic-auth","basic-authentication","language","nodejs","now","serverless","static-site","vercel","vercel-now"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hormesiel.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},"funding":{"github":"hormesiel"}},"created_at":"2019-01-21T18:22:23.000Z","updated_at":"2025-02-04T16:25:15.000Z","dependencies_parsed_at":"2023-02-08T09:31:49.707Z","dependency_job_id":"5b6e8e78-768a-4584-959f-017784e9f5b1","html_url":"https://github.com/hormesiel/vercel-basic-auth","commit_stats":{"total_commits":126,"total_committers":5,"mean_commits":25.2,"dds":0.373015873015873,"last_synced_commit":"02b7917d1afda9b4121001a32eba9617cf2c0e4f"},"previous_names":["hormesiel/vercel-basic-auth"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hormesiel%2Fvercel-basic-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hormesiel%2Fvercel-basic-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hormesiel%2Fvercel-basic-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hormesiel%2Fvercel-basic-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hormesiel","download_url":"https://codeload.github.com/hormesiel/vercel-basic-auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393570,"owners_count":20931813,"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":["authentication","basic-auth","basic-authentication","language","nodejs","now","serverless","static-site","vercel","vercel-now"],"created_at":"2024-10-24T07:23:39.406Z","updated_at":"2025-04-05T20:08:26.699Z","avatar_url":"https://github.com/hormesiel.png","language":"TypeScript","readme":"## Goal\n\nThis repo contains examples of how to add *Basic Authentication* to a Vercel deployment using various languages / frameworks, along with some numbers that show the differences between each method.\n\nEach example contains its own README file with some additional information.\n\n## Adding basic auth to SSR / API routes\n\nAll the examples in this repo only show how to add basic auth to **static pages**. If you want to add basic auth to SSR or API routes, you'll have to do it manually or use a package specifically designed for the framework you're using, like [nextjs-basic-auth-middleware](https://www.npmjs.com/package/nextjs-basic-auth-middleware) if your project uses Next.js.\n\n## Structure\n\n- The `_static` directory contains the source code for the \"website\" that each implementation serves for demonstration purposes : HTML, CSS, images ... \u003csup\u003e1\u003c/sup\u003e\n- All the other directories are the different ways you can add Basic Authentication to a Vercel deployment. Checkout their code to see how to implement it in your project\n\n\u003csup\u003e1\u003c/sup\u003e The demo website has a public area and a restricted `/admin` area **(username / pass : `admin` / `admin`)**.\n\n## Comparison\n\n| Example          | 📦 Lambda size | 🔗 Deployment URL                                             | 👨‍💻 Ease of implementation |\n| ---------------- | -------------- | -------------------------------------------------------------- | ----------------------------- |\n| node             | 0.08 MB        | [Link](https://vercel-basic-auth-node.vercel.app/)             | ⭐                            |\n| node-express     | 0.38 MB        | [Link](https://vercel-basic-auth-node-express.vercel.app/)     | ⭐⭐                         |\n| node-static-auth | 0.08 MB        | [Link](https://vercel-basic-auth-node-static-auth.vercel.app/) | ⭐⭐⭐                       |\n\n## Contributing\n\nIssues and PR are welcome!\n\n- 🔀 Fork and clone the project\n- 🆕 Create a directory named after the language / framework you want to add (for example `php` or `node-polka`)\n- 👨‍💻 Add the implementation\n- 🎉 Submit your PR\n","funding_links":["https://github.com/sponsors/hormesiel"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhormesiel%2Fvercel-basic-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhormesiel%2Fvercel-basic-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhormesiel%2Fvercel-basic-auth/lists"}