Overview
Composables
Nuxt API Party provides two distinct composable types to return data from your APIs. All composables are auto-imported and globally available within your components:
- Async data composable – Returns multiple values similar to
useFetch
. A generated name might beuseMyApiData
. - Plain fetch composable – Returns the response data, similar to
$fetch
. A generated name might be$myApi
.
The actual composables (and their names) are generated based on your API endpoint ID.
Generated Composables
The composables are generated based on your API endpoint ID. For example, if you were to call your API jsonPlaceholder
, the generated composables are:
$jsonPlaceholder
useJsonPlaceholderData