---
description: Subscribe to hook and react to a request sent to your Laravel API.
---

# sanctum:request

When your Nuxt application sends any request against the Laravel API, you can subscribe to the `sanctum:request` hook the same way as the ofetch interceptor `onRequest`. More details about interceptors can be found here - [interceptors](../advanced/interceptors).

{% code title="plugins/sanctum-listener.ts" %}
```typescript
export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.hook('sanctum:request', (nuxtApp, context, logger) => {
    logger.info('Sanctum request hook triggered', context.request)
  })
})
```
{% endcode %}

Here is what the hook looks like

```typescript
interface RuntimeNuxtHooks {
  /**
   * Triggers on every client request.
   */
  'sanctum:request': (app: NuxtApp, ctx: FetchContext, logger: ConsolaInstance) => HookResult
}
```
