{"id":13406434,"url":"https://github.com/nextauthjs/next-auth-example","last_synced_at":"2025-05-13T23:06:44.043Z","repository":{"id":37245223,"uuid":"262579731","full_name":"nextauthjs/next-auth-example","owner":"nextauthjs","description":"Example showing how to use NextAuth.js with Next.js","archived":false,"fork":false,"pushed_at":"2025-02-27T09:00:34.000Z","size":1053,"stargazers_count":3882,"open_issues_count":11,"forks_count":1199,"subscribers_count":31,"default_branch":"main","last_synced_at":"2025-04-10T00:14:33.515Z","etag":null,"topics":["authentication","nextjs","oauth","passwordless"],"latest_commit_sha":null,"homepage":"https://next-auth-example.vercel.app","language":"TypeScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nextauthjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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":{"open_collective":"nextauth","github":["balazsorban44","ThangHuuVu"]}},"created_at":"2020-05-09T13:42:54.000Z","updated_at":"2025-04-09T07:09:39.000Z","dependencies_parsed_at":"2023-12-25T10:38:37.915Z","dependency_job_id":"45b3685b-bf18-4cf6-97ad-21829da3c41b","html_url":"https://github.com/nextauthjs/next-auth-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextauthjs%2Fnext-auth-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextauthjs%2Fnext-auth-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextauthjs%2Fnext-auth-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextauthjs%2Fnext-auth-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nextauthjs","download_url":"https://codeload.github.com/nextauthjs/next-auth-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254040935,"owners_count":22004632,"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","nextjs","oauth","passwordless"],"created_at":"2024-07-30T19:02:30.227Z","updated_at":"2025-05-13T23:06:39.032Z","avatar_url":"https://github.com/nextauthjs.png","language":"TypeScript","readme":"\u003e The example repository is maintained from a [monorepo](https://github.com/nextauthjs/next-auth/tree/main/apps/examples/nextjs). Pull Requests should be opened against [`nextauthjs/next-auth`](https://github.com/nextauthjs/next-auth).\n\n\u003cp align=\"center\"\u003e\n   \u003cbr/\u003e\n   \u003ca href=\"https://authjs.dev\" target=\"_blank\"\u003e\u003cimg width=\"150px\" src=\"https://authjs.dev/img/logo-sm.png\" /\u003e\u003c/a\u003e\n   \u003ch3 align=\"center\"\u003eNextAuth.js Example App\u003c/h3\u003e\n   \u003cp align=\"center\"\u003e\n   Open Source. Full Stack. Own Your Data.\n   \u003c/p\u003e\n   \u003cp align=\"center\" style=\"align: center;\"\u003e\n      \u003ca href=\"https://npm.im/next-auth\"\u003e\n        \u003cimg alt=\"npm\" src=\"https://img.shields.io/npm/v/next-auth?color=green\u0026label=next-auth\"\u003e\n      \u003c/a\u003e\n      \u003ca href=\"https://bundlephobia.com/result?p=next-auth-example\"\u003e\n        \u003cimg src=\"https://img.shields.io/bundlephobia/minzip/next-auth?label=next-auth\" alt=\"Bundle Size\"/\u003e\n      \u003c/a\u003e\n      \u003ca href=\"https://www.npmtrends.com/next-auth\"\u003e\n        \u003cimg src=\"https://img.shields.io/npm/dm/next-auth?label=next-auth%20downloads\" alt=\"Downloads\" /\u003e\n      \u003c/a\u003e\n      \u003ca href=\"https://npm.im/next-auth\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/npm-TypeScript-blue\" alt=\"TypeScript\" /\u003e\n      \u003c/a\u003e\n   \u003c/p\u003e\n\u003c/p\u003e\n\n## Overview\n\nNextAuth.js is a complete open source authentication solution.\n\nThis is an example application that shows how `next-auth` is applied to a basic Next.js app.\n\nThe deployed version can be found at [`next-auth-example.vercel.app`](https://next-auth-example.vercel.app)\n\n### About NextAuth.js\n\nNextAuth.js is an easy to implement, full-stack (client/server) open source authentication library originally designed for [Next.js](https://nextjs.org) and [Serverless](https://vercel.com). Our goal is to [support even more frameworks](https://github.com/nextauthjs/next-auth/issues/2294) in the future.\n\nGo to [next-auth.js.org](https://authjs.dev) for more information and documentation.\n\n\u003e _NextAuth.js is not officially associated with Vercel or Next.js._\n\n## Getting Started\n\n### 1. Clone the repository and install dependencies\n\n```\ngit clone https://github.com/nextauthjs/next-auth-example.git\ncd next-auth-example\npnpm install\n```\n\n### 2. Configure your local environment\n\nCopy the .env.local.example file in this directory to .env.local (which will be ignored by Git):\n\n```\ncp .env.local.example .env.local\n```\n\nAdd details for one or more providers (e.g. Google, Twitter, GitHub, Email, etc).\n\n#### Database\n\nA database is needed to persist user accounts and to support email sign in. However, you can still use NextAuth.js for authentication without a database by using OAuth for authentication. If you do not specify a database, [JSON Web Tokens](https://jwt.io/introduction) will be enabled by default.\n\nYou **can** skip configuring a database and come back to it later if you want.\n\nFor more information about setting up a database, please check out the following links:\n\n- Docs: [authjs.dev/reference/core/adapters](https://authjs.dev/reference/core/adapters)\n\n### 3. Configure Authentication Providers\n\n1. Review and update options in `auth.ts` as needed.\n\n2. When setting up OAuth, in the developer admin page for each of your OAuth services, you should configure the callback URL to use a callback path of `{server}/api/auth/callback/{provider}`.\n\ne.g. For Google OAuth you would use: `http://localhost:3000/api/auth/callback/google`\n\nA list of configured providers and their callback URLs is available from the endpoint `api/auth/providers`. You can find more information at https://authjs.dev/getting-started/providers/oauth-tutorial\n\n1. You can also choose to specify an SMTP server for passwordless sign in via email.\n\n### 4. Start the application\n\nTo run your site locally, use:\n\n```\npnpm run dev\n```\n\nTo run it in production mode, use:\n\n```\npnpm run build\npnpm run start\n```\n\n### 5. Preparing for Production\n\nFollow the [Deployment documentation](https://authjs.dev/getting-started/deployment)\n\n## Acknowledgements\n\n\u003ca href=\"https://vercel.com?utm_source=nextauthjs\u0026utm_campaign=oss\"\u003e\n\u003cimg width=\"170px\" src=\"https://raw.githubusercontent.com/nextauthjs/next-auth/main/docs/public/img/etc/powered-by-vercel.svg\" alt=\"Powered By Vercel\" /\u003e\n\u003c/a\u003e\n\u003cp align=\"left\"\u003eThanks to Vercel sponsoring this project by allowing it to be deployed for free for the entire NextAuth.js Team\u003c/p\u003e\n\n## License\n\nISC\n","funding_links":["https://opencollective.com/nextauth","https://github.com/sponsors/balazsorban44","https://github.com/sponsors/ThangHuuVu"],"categories":["TypeScript","JavaScript","Nextjs Starter"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextauthjs%2Fnext-auth-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextauthjs%2Fnext-auth-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextauthjs%2Fnext-auth-example/lists"}