useSanctumFetch
Besides useSanctumClient
you can directly send a request by using a module-specific version of fetch composable - useSanctumFetch
.
This composable implements a similar interface to useFetch
, so you can check more details here.
Composable accepts 3 arguments:
endpoint URL to call
FetchOptions
to pass to the Sanctum client (ofetch
)AsyncDataOptions
to pass touseAsyncData
under the hood
components/YourComponent.vue
You can also use type casting to work with response as an interface:
Last updated