
Security News
Knip Hits 500 Releases with v5.62.0, Improving TypeScript Config Detection and Plugin Integrations
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
@sidebase/nuxt-auth
Advanced tools
Authentication built for Nuxt 3! Easily add authentication via OAuth providers, credentials or Email Magic URLs!
Authentication built for Nuxt 3! Easily add authentication via OAuth providers, credentials or Email Magic URLs!
npx nuxi@latest module add sidebase-auth
npm i -D @sidebase/nuxt-auth
pnpm i -D @sidebase/nuxt-auth
yarn add --dev @sidebase/nuxt-auth
nuxt.config.ts
export default defineNuxtConfig({
modules: ['@sidebase/nuxt-auth']
})
Then visit the Quick Start documentation to continue the configuration of your app!
@sidebase/nuxt-auth
is a library with the goal of supporting authentication for any universal Nuxt 3 application. At the moment three providers are supported:
authjs
: for non-static apps that want to use Auth.js / NextAuth.js to offer the reliability & convenience of a 23k star library to the Nuxt 3 ecosystem with a native developer experience (DX)local
: for static pages that rely on an external backend with a credential flow for authentication. The Local Provider also supports refresh tokens since v0.9.0
. Read more here.You can find a full list of our features, as well as which provider supports each feature on our docs.
useAuth
status
, data
and lastRefreshedAt
getSession
, getCsrfToken
, getProviders
, signIn
and signOut
RefreshHandler
getServerSession
getToken
Want to get a preview of what @sidebase/nuxt-auth
has to offer? Visit the nuxt-auth
demo page here. Peak into the demo source-code here.
This project uses pnpm
for development.
pnpm dev:prepare
to generate type stubs.pnpm dev
inside a module playground directory to start a playground in development mode.pnpm lint
to run eslintpnpm typecheck
to run typescheck via tscpnpm publish --access public
to publishpnpm publish --access public --tag next
to publish a pre-releaseThis module also has it's own playground:
> git clone https://github.com/sidebase/nuxt-auth
> cd nuxt-auth
> cd playground-[PROVIDER]
> pnpm i
> pnpm dev:prepare
> pnpm dev
pnpm dev:prepare
to generate type stubs.pnpm dev
to start the playground.pnpm test:e2e
to run the end-to-end tests.pnpm lint
to run eslintpnpm typecheck
to run typescheck via tscWe have one playground per provider:
To test static Nuxt 3 apps we want to run a static frontend and a separate backend that will take over authentication:
playground-local/nuxt.config.ts
: Add baseURL: 'http://localhost:3001'
to the auth
-configcd playground-local
pnpm generate
pnpm start
cd playground-local
pnpm dev
# A second Nuxt app should now be running on http://localhost:3001.
# We use this purely for authentication
3001
Thank you to everyone who has contributed to this project by writing issues or opening pull requests. Your efforts help us improve and grow. If you are interested in contributing, please take a moment to review our Contributing Guidelines. We appreciate your support and look forward to your contributions!
@sidebase/nuxt-auth
is supported by all of our amazing contributors and the Nuxt 3 team!
FAQs
Authentication built for Nuxt 3! Easily add authentication via OAuth providers, credentials or Email Magic URLs!
The npm package @sidebase/nuxt-auth receives a total of 16,874 weekly downloads. As such, @sidebase/nuxt-auth popularity was classified as popular.
We found that @sidebase/nuxt-auth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Knip hits 500 releases with v5.62.0, refining TypeScript config detection and updating plugins as monthly npm downloads approach 12M.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.