The useStatamicFetch composable is a wrapper around the useFetch composable that uses the $api instance to fetch data from a Statamic API endpoint.
This is useful when you need to fetch data from a Statamic API endpoint that is not covered by the useStatamicApi composable.
<script setup lang="ts">
const { data } = await useStatamicFetch("/api/tenants");
</script>
function useStatamicFetch<T>(
url: string | (() => string),
options?: UseFetchOptions<T>,
)
useFetch composable.