Installation

You can install nuxt-auth using nuxi:

npx nuxi@latest module add sidebase-auth

Specifics: authjs-Provider

If you want to use the authjs provider, you have to install next-auth. With all package managers except npm you must manually install the peer dependency alongside nuxt-auth:

yarn
yarn add [email protected]
pnpm
pnpm i [email protected]
Due to a breaking change in NextAuth, nuxt-auth is only compoatible with NextAuth versions under v4.23.0. We recommend pinning the version to 4.22.5. See more here.
Note that we try our best to keep nuxt-auth stable, but it is also a fresh module that is in active development. If you want to be extra sure nothing breaks, you should pin the patch version, e.g., by using --save-exact when running the install command.

You can find all available next-auth versions on npm. You do not need to install any other peer-dependencies in order to use nuxt-auth.

If you are unsure which provider to choose, have a look at the overview on the getting-started page.

Specifics: local/refresh-Provider

The local provider does not have any specific extra dependencies. However, you will need to make sure that you have a backend somewhere that provides username + password based authentication, read more about this on the quick-start page.

If you are unsure which provider to choose, have a look at the overview on the getting-started page.

Requirements

nuxt-auth only needs Nuxt 3 to run. In the future Nuxt 2 or Nuxt Bridge may be supported.