{"id":16903843,"url":"https://github.com/colinhacks/next-firebase-ssr","last_synced_at":"2025-04-05T13:08:33.602Z","repository":{"id":44767204,"uuid":"286338785","full_name":"colinhacks/next-firebase-ssr","owner":"colinhacks","description":"An Next.js example repo for building authenticated pages with Firebase Authentication, cookies, and getServerSideProps","archived":false,"fork":false,"pushed_at":"2022-12-10T22:07:32.000Z","size":281,"stargazers_count":427,"open_issues_count":11,"forks_count":61,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-29T12:08:39.603Z","etag":null,"topics":["authentication","firebase","firebase-auth","nextjs","ssr"],"latest_commit_sha":null,"homepage":"https://vriad.com/essays/nextjs-firebase-authentication","language":"TypeScript","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/colinhacks.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-08-10T00:14:47.000Z","updated_at":"2025-01-28T19:45:14.000Z","dependencies_parsed_at":"2023-01-26T12:01:05.660Z","dependency_job_id":null,"html_url":"https://github.com/colinhacks/next-firebase-ssr","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/colinhacks%2Fnext-firebase-ssr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinhacks%2Fnext-firebase-ssr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinhacks%2Fnext-firebase-ssr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinhacks%2Fnext-firebase-ssr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colinhacks","download_url":"https://codeload.github.com/colinhacks/next-firebase-ssr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339158,"owners_count":20923014,"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","firebase","firebase-auth","nextjs","ssr"],"created_at":"2024-10-13T18:29:00.091Z","updated_at":"2025-04-05T13:08:33.581Z","avatar_url":"https://github.com/colinhacks.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Next.js + Firebase + getServerSideProps\n\nThis project demonstrates how to implement authenticated server-side rendering with Next.js and Firebase Authentication.\n\n\u003e Update November 19, 2020: A bug has been fixed where the Firebase tokens would expire after an hour without being refreshed. All tokens are now force refreshed every 10 minutes.\n\n\u003e Update November 9, 2020: this repo has been updated to use the [redirect functionality](https://github.com/vercel/next.js/discussions/14890) introduced in `next@9.5.4` . Currently you must be on the `canary` release of Next for this approach to work ( `yarn add next@canary` ).\n\n### Versions\n\n* `next@10`\n* `react@17`\n* `firebase@8`\n* `firebase-admin@9.4`\n* `nookies@2.5`\n\n### Documentation\n\nFull walkthrough and documentation here: [Authenticated server-side rendering with Next.js and Firebase](https://colinhacks.com/essays/nextjs-firebase-authentication).\n\n### How to use\n\nTo run this example:\n\n* Clone the repo: `git clone git@github.com:vriad/next-firebase-ssr.git`\n* Navigate into directory: `cd next-firebase-ssr`\n* Install dependencies: `yarn`\n* Create a Firebase project if you haven't already. Make sure you go into the Authentication tab in the Console, go to \"Sign-in method\", and enable \"Email/Password\"\n* Add your Firebase client credentials to `firebaseClient.ts`. To get these, go to the Firebase Console \u003e open your project \u003e Gear Icon \u003e Project Settings \u003e General \u003e Your apps \u003e Firebase SDK Snippet \u003e click the \"Config\" radio button \u003e copy/paste.\n* Add your service account (Admin) credentials to the project. To do this, go to the Firebase Console \u003e open your project \u003e click the gear icon \u003e Project Settings \u003e Service Accounts \u003e click Node.js \u003e Generate new private key. Open the JSON file that downloads. Then create a copy of `.env.local.example` and rename it to `.env.local`. This is the file where you will put your secret Firebase credentials. Copy/paste the  values from the private key JSON file over to the new `.env.local` file:  `privateKey` becomes `PRIVATE_KEY`,   `project_id` becomes `PROJECT_ID`, and `clientEmail` becomes `CLIENT_EMAIL`.\n* Run `yarn dev`\n* Go to `localhost:3000`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinhacks%2Fnext-firebase-ssr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolinhacks%2Fnext-firebase-ssr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinhacks%2Fnext-firebase-ssr/lists"}