Nuxt - Laravel Sanctum
GitHubNuxt Module
0.6
0.6
  • Getting Started
    • Introduction
    • Installation
  • Usage
    • Configuration
    • Cookie Authentication
    • Token Authentication
  • Composables
    • useSanctumAuth
    • useSanctumUser
    • useSanctumClient
    • useSanctumFetch
    • useLazySanctumFetch
    • useSanctumConfig
    • useSanctumAppConfig
  • Middleware
    • sanctum:auth
    • sanctum:guest
    • Global middleware
  • Hooks
    • sanctum:error
    • sanctum:error:request
    • sanctum:redirect
    • sanctum:init
    • sanctum:refresh
    • sanctum:login
    • sanctum:logout
  • Advanced
    • Interceptors
    • Error handling
    • Logging
    • Token storage
    • Plugin dependencies
    • Breeze Nuxt template
    • Troubleshooting
Powered by GitBook
On this page
  • Top Features
  • Support
Edit on GitHub
  1. Getting Started

Introduction

This module provides a simple way to use Laravel Sanctum with Nuxt. SSR-ready!

NextInstallation

Last updated 2 months ago

Top Features

  • useSanctumAuth composable for easy access to the current user and authentication methods

  • useSanctumFetch and useLazySanctumFetch to load data from your API

  • Automated CSRF token header and cookie management

  • Automated Bearer token header management

  • Both CSR and SSR modes support

  • Pre-configured middleware for pages that require authentication

  • Cast current user information to any class you want

  • Custom request and response interceptors

  • Subscribe to sanctum:* hooks to react as you want

  • Compatible with default Nuxt ofetch client

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

We recommend looking at our template that works flawlessly with Laravel application.

Support

If you use this module, please support me to help to maintain and improve it!

here
breeze-nuxt
breeze-api