nuxt-auth-sanctum
Nuxt module for Laravel Sanctum authentication
325,199
287
| Install | |
|---|---|
npm install nuxt-auth-sanctum |
|
| Latest Version: | 3.1.4 |
| Vue: | 3 |
| License: | MIT |
| Last Updated: | Oct 19, 2026 |
| Links: | GitHub · npm |
Maintainer: manchenkoff
Nuxt Auth Sanctum
This module provides a simple way to use Laravel Sanctum with Nuxt by leveraging cookies-based authentication. SSR-ready!
Features
This module includes a range of features designed to streamline authentication:
useSanctumAuthcomposable for easy access to the current user and authentication methodsuseSanctumFetchanduseLazySanctumFetchto load data from your API- Automated
CSRFtoken header and cookie management - Automated
Bearertoken header management - Both
CSRandSSRmodes support - Pre-configured middleware for pages that require authentication
- Cast current user information to any class you want
- Custom
requestandresponseinterceptors - Subscribe to
sanctum:*hooks to react as you want - Compatible with default Nuxt
ofetchclient - TypeScript support
- ... and more, check the docs!
Note: Before using this module, please make sure that you have already configured Laravel Sanctum on your backend. You can find more information about Laravel Sanctum here.
Complete documentation - Nuxt Auth Sanctum docs
Quick Setup
- Add
nuxt-auth-sanctumdependency to your project
npx nuxi@latest module add nuxt-auth-sanctum
- Add any required configuration in your
nuxt.config.tsfile
export default defineNuxtConfig({
modules: ["nuxt-auth-sanctum"],
sanctum: {
baseUrl: "http://localhost:80", // Laravel API
},
});
That's it! You can now use Nuxt Auth Sanctum in your Nuxt app ✨
For more details, check the documentation here
Powered by
Version History
| Version | Released | License |
|---|---|---|
| 3.1.4 | MIT | |
| 3.1.3 | MIT | |
| 3.1.2 | MIT | |
| 3.1.1 | MIT | |
| 3.1.0 | MIT | |
| 3.0.0 | MIT | |
| 2.3.5 | MIT | |
| 2.3.4 | MIT | |
| 2.3.3 | MIT | |
| 2.3.2 | MIT | |
| 2.3.1 | MIT | |
| 2.3.0 | MIT | |
| 2.2.0 | MIT | |
| 2.1.3 | MIT | |
| 2.1.2 | MIT | |
| 2.1.1 | MIT | |
| 2.1.0 | MIT | |
| 2.0.0 | MIT | |
| 1.4.3 | MIT | |
| 1.4.2 | MIT | |
| 1.4.1 | MIT | |
| 1.4.0 | MIT | |
| 1.3.1 | MIT | |
| 1.3.0 | MIT | |
| 1.2.0 | MIT | |
| 1.1.2 | MIT | |
| 1.1.1 | MIT | |
| 1.1.0 | MIT | |
| 1.0.1 | MIT | |
| 1.0.0 | MIT |
Showing the latest 30 of 104. See every release on npm
Pre-releases (5)
| Version | Released | License |
|---|---|---|
| 1.4.1-4 | MIT | |
| 1.4.1-3 | MIT | |
| 1.4.1-2 | MIT | |
| 1.4.1-1 | MIT | |
| 1.4.1-0 | MIT |