{"id":18390617,"url":"https://github.com/nextauthjs/next-auth-refresh-token-example","last_synced_at":"2025-08-28T08:17:49.265Z","repository":{"id":39257425,"uuid":"431272047","full_name":"nextauthjs/next-auth-refresh-token-example","owner":"nextauthjs","description":"NextAuth.js Refresh Token Example","archived":false,"fork":false,"pushed_at":"2023-06-11T07:07:40.000Z","size":31,"stargazers_count":108,"open_issues_count":2,"forks_count":20,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-07T02:37:57.171Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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":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}},"created_at":"2021-11-23T22:27:35.000Z","updated_at":"2025-03-03T19:39:11.000Z","dependencies_parsed_at":"2024-01-30T02:12:25.756Z","dependency_job_id":null,"html_url":"https://github.com/nextauthjs/next-auth-refresh-token-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nextauthjs/next-auth-refresh-token-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextauthjs%2Fnext-auth-refresh-token-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextauthjs%2Fnext-auth-refresh-token-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextauthjs%2Fnext-auth-refresh-token-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextauthjs%2Fnext-auth-refresh-token-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nextauthjs","download_url":"https://codeload.github.com/nextauthjs/next-auth-refresh-token-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextauthjs%2Fnext-auth-refresh-token-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272468463,"owners_count":24939728,"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","status":"online","status_checked_at":"2025-08-28T02:00:10.768Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-06T01:48:36.366Z","updated_at":"2025-08-28T08:17:49.225Z","avatar_url":"https://github.com/nextauthjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n   \u003cbr/\u003e\n   \u003ca href=\"https://next-auth.js.org\" target=\"_blank\"\u003e\u003cimg width=\"150px\" src=\"https://next-auth.js.org/img/logo/logo-sm.png\" /\u003e\u003c/a\u003e\n   \u003ch3 align=\"center\"\u003eNextAuth.js Refresh Token Example\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   \u003c/p\u003e\n\u003c/p\u003e\n\n## Overview\n\nNextAuth.js is a complete open source authentication solution for [Next.js](http://nextjs.org/) applications.\n\nThis is an example application which shows how `next-auth` can be used to refresh a JWT `accessToken` via the `refreshToken`.\n\nThanks to [`@agusterodin`](https://github.com/agusterodin) for this usage example! See: [next-auth/docs#117](https://github.com/nextauthjs/docs/pull/117).\n\n### About NextAuth.js\n\nNextAuth.js is an easy to implement, full-stack (client/server) open source authentication library designed for [Next.js](https://nextjs.org) and [Serverless](https://vercel.com).\n\nGo to [next-auth.js.org](https://next-auth.js.org) 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-refresh-token-example.git\ncd next-auth-refresh-token-example\nnpm 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### 3. Configure Authentication Providers\n\n1. Review and update options in `pages/api/auth/[...nextauth].js` 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://next-auth.js.org/configuration/providers\n\n3. 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```\nnpm run dev\n```\n\nTo run it in production mode, use:\n\n```\nnpm run build\nnpm run start\n```\n\n### 5. Preparing for Production\n\nYou must set the `NEXTAUTH_URL` environment variable with the URL of your site, before deploying to production.\n\ne.g. in your `.env.local` file - `NEXTAUTH_URL=https://example.com`\n\nTo do this with Vercel, you can use the [Vercel project dashboard](https://vercel.com/dashboard) or their cli via the `vc env` command:\n\n```\nvc env add NEXTAUTH_URL production\n```\n\nDo not forget to set the environment variables for the Client ID and Client Secret values for all your configured authentication providers in your hosting providers dashboard, i.e. with Vercel as described above.\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/canary/www/static/img/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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextauthjs%2Fnext-auth-refresh-token-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextauthjs%2Fnext-auth-refresh-token-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextauthjs%2Fnext-auth-refresh-token-example/lists"}