Getting Started
Introduction
Welcome to Nuxt Laravel Sanctum module documentation
This module provides a simple way to use Laravel Sanctum with Nuxt. SSR-ready!
Key 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 ensure you have configured Laravel Sanctum on your backend.
You can find more information about Laravel Sanctum here.
We recommend looking at our breeze-nuxt template that works flawlessly with breeze-api Laravel application with preconfigured Sanctum and Echo modules.
Ecosystem
This project is a part of Nuxt Laravel modules ecosystem which you may find useful:
Support
If you like this module, please support the project to help me maintain and improve it!
