You are viewing the docs for v0.6. This is not the latest version.

Installation

You can install nuxt-auth via npm, yarn or pnpm:

npm
npm i -D @sidebase/nuxt-auth
yarn
yarn add --dev @sidebase/nuxt-auth
pnpm
pnpm i -D @sidebase/nuxt-auth
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.

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]

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-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.