Skip to content

useSanctumOptions()

useSanctumOptions() provides direct access to the module's configuration settings. It is a convenient alternative to using Nuxt 3's useRuntimeConfig() to retrieve configuration values.

Features

  • Quick Configuration Access:
    Instead of manually retrieving configuration options via useRuntimeConfig(), useSanctumOptions() provides a straightforward way to access settings like API endpoints, authentication modes, and more.

    Example:

    javascript
    const options = useSanctumOptions();
    
    console.log(options.apiUrl);
    // Outputs runtimeConfig.public.laravelSanctum.apiUrl
  • Centralized Configuration Management: By using this composable, you ensure that all parts of your application access the same configuration settings, reducing the risk of inconsistencies.