X Enterprises
Composables

useDomain

Builds and returns typed API endpoint methods for all restaurant data resources.

useDomain

API endpoint management composable. Reads runtimeConfig.public.apiEndpoint and the domain set in app.config.ts to construct typed fetch methods for every restaurant data resource the layer consumes.

Usage

const {
  getInfo,
  getRestaurants,
  getRestaurantBySlug,
  getRestaurantMenuBySlug,
  getRestaurantReviewsBySlug,
  getRestaurantPhotosBySlug,
  getRestaurantsSearch,
  getRestaurantsFeatured,
  getRestaurantsNew,
  getRestaurantsRandom,
  getRestaurantsTopRated,
  getSitemap,
} = useDomain()

Returns

KeyTypeDescription
getInfo() => Promise<T>Fetches general domain/site information.
getRestaurants() => Promise<T>Fetches the full restaurant listing.
getRestaurantBySlug(slug: string) => Promise<T>Fetches a single restaurant by its slug.
getRestaurantMenuBySlug(slug: string) => Promise<T>Fetches the menu for a restaurant.
getRestaurantReviewsBySlug(slug: string) => Promise<T>Fetches reviews for a restaurant.
getRestaurantPhotosBySlug(slug: string) => Promise<T>Fetches photos for a restaurant.
getRestaurantsSearch(query: string) => Promise<T>Full-text search across restaurants.
getRestaurantsFeatured() => Promise<T>Fetches the featured restaurants list.
getRestaurantsNew() => Promise<T>Fetches newly added restaurants.
getRestaurantsRandom() => Promise<T>Fetches a random selection of restaurants.
getRestaurantsTopRated() => Promise<T>Fetches top-rated restaurants.
getSitemap() => Promise<T>Fetches sitemap data for all restaurant slugs.

AI Context

composable: useDomain
package: "@xenterprises/nuxt-x-restaurants"
use-when: >
  Fetching any restaurant data from the API — listing, individual profile,
  menu, reviews, photos, featured/new/random/top-rated collections, search,
  or sitemap generation. All page-level data fetching goes through this composable.
Copyright © 2026