Augur

augur-hooks

React Query hooks and Zustand stores for Augur data.

@simpleapps-com/augur-hooks

React Query hooks and Zustand stores for Augur data. Cross-platform — safe for React Native and web.

npm install @simpleapps-com/augur-hooks

Entry Points

ImportEnvironmentPurpose
augur-hooksCross-platformHooks, stores, provider, types
augur-hooks/serverNext.js App RouterServer-side prefetching, query options, keys
augur-hooks/webBrowser onlyDOM-dependent hooks (mobile detection, intersection)

Client Exports

ExportDescription
AugurHooksProviderContext provider that supplies the Augur API client, auth, and callbacks to all hooks
useAugurApiReturns the Augur API client from context (throws if missing)
useAugurApiOptionalReturns the Augur API client from context or undefined if missing
useAugurAuthReturns the current auth context (customer ID, session, etc.)
useAugurCacheReturns the cache configuration from context
useAugurSiteReturns the site configuration from context (defaults, formatting, analytics)
useAugurOptionsReturns a deep proxy that produces TanStack Query options for every SDK method
useCartStoreZustand store for cart state (header UID, lines, totals)
useCartHdrUidSelector: current cart header UID
useCartLinesSelector: current cart line items
useCartQuantityTotalSelector: sum of all line quantities in the cart
useCartLineCountSelector: number of distinct lines in the cart
useSetCartHdrUidAction: set the cart header UID
useSetCartLinesAction: replace all cart line items
useClearCartAction: clear all cart state
useItemFiltersStoreZustand store for item list filter/sort state
useDebounceDebounces a value by a configurable delay
useFormatPriceFormats a numeric price using the site's locale and currency
useItemPriceFetches real-time pricing for a single item
getItemPriceKeyQuery key factory for item price queries
getItemPriceOptionsQuery options factory for item price queries
useInvMastDocFetches the inventory master document for a single item
getInvMastDocKeyQuery key factory for inv-mast-doc queries
getInvMastDocOptionsQuery options factory for inv-mast-doc queries
useItemCategoryFetches an item category by ID
getItemCategoryKeyQuery key factory for item category queries
getItemCategoryOptionsQuery options factory for item category queries
useInvMastFetches inventory master record for a single item
getInvMastKeyQuery key factory for inv-mast queries
getInvMastOptionsQuery options factory for inv-mast queries
useInvMastStockFetches stock/availability data for a single item
getInvMastStockKeyQuery key factory for inv-mast-stock queries
getInvMastStockOptionsQuery options factory for inv-mast-stock queries
useStockFetches full TStock data and resolves it into normalized stock state
getStockKeyQuery key factory for stock queries
getStockOptionsQuery options factory for stock queries
useBatchInvMastDocFetches inventory master documents for multiple items in one query
getBatchInvMastDocKeyQuery key factory for batch inv-mast-doc queries
getBatchInvMastDocOptionsQuery options factory for batch inv-mast-doc queries
executeBatchQueryExecutes a batch query that splits large ID lists into chunked parallel requests
useProductCategoryFetches a product category with its metadata
getProductCategoryKeyQuery key factory for product category queries
getProductCategoryOptionsQuery options factory for product category queries
useItemDetailsFetches full item details (description, images, specs)
getItemDetailsKeyQuery key factory for item details queries
getItemDetailsOptionsQuery options factory for item details queries
useItemAttributesFetches item attributes (custom fields, dimensions, etc.)
getItemAttributesKeyQuery key factory for item attributes queries
getItemAttributesOptionsQuery options factory for item attributes queries
useProductSearchExecutes a paginated product search
getProductSearchKeyQuery key factory for product search queries
getProductSearchOptionsQuery options factory for product search queries
useSearchSuggestionsFetches typeahead search suggestions for a query string
getSearchSuggestionsKeyQuery key factory for search suggestions queries
getSearchSuggestionsOptionsQuery options factory for search suggestions queries
useCartActionsProvides add/update/remove cart mutation actions
useCartInitializationInitializes cart state from session on mount
useCartPricingFetches computed cart pricing (subtotal, tax, shipping)
getCartPricingQueryOptionsQuery options factory for cart pricing queries
usePaginationPrefetchPrefetches adjacent pages for faster pagination navigation
useCategoryItemsInfiniteInfinite-scroll query for items in a category
getCategoryItemsInfiniteKeyQuery key factory for category items infinite queries
getCategoryItemsInfiniteOptionsQuery options factory for category items infinite queries
useItemSearchInfiniteInfinite-scroll query for item search results
getItemSearchInfiniteKeyQuery key factory for item search infinite queries
getItemSearchInfiniteOptionsQuery options factory for item search infinite queries
useJoomlaContentFetches a single Joomla article by ID
getJoomlaContentKeyQuery key factory for Joomla content queries
getJoomlaContentOptionsQuery options factory for Joomla content queries
useJoomlaContentListFetches a list of Joomla articles by category
getJoomlaContentListKeyQuery key factory for Joomla content list queries
getJoomlaContentListOptionsQuery options factory for Joomla content list queries
useJoomlaMenuFetches Joomla menu items for site navigation
getJoomlaMenuKeyQuery key factory for Joomla menu queries
getJoomlaMenuOptionsQuery options factory for Joomla menu queries
useJoomlaMenuDocFetches a single Joomla menu item document
getJoomlaMenuDocKeyQuery key factory for Joomla menu doc queries
getJoomlaMenuDocOptionsQuery options factory for Joomla menu doc queries
useCustomerOrdersFetches paginated order history for a customer
useOrderDetailFetches full details for a single order
getCustomerOrdersKeyQuery key factory for customer orders queries
getCustomerOrderDetailKeyQuery key factory for order detail queries
useCustomerInvoicesFetches paginated invoice history for a customer
useInvoiceDetailFetches full details for a single invoice
getCustomerInvoicesKeyQuery key factory for customer invoices queries
getCustomerInvoiceDetailKeyQuery key factory for invoice detail queries
useCustomerQuotesFetches paginated quote history for a customer
useQuoteDetailFetches full details for a single quote
getCustomerQuotesKeyQuery key factory for customer quotes queries
getCustomerQuoteDetailKeyQuery key factory for quote detail queries
createSiteHooksFactory that creates site-specific hook wrappers with baked-in API config
useAugurPersistenceProvides offline persistence for React Query cache via configurable storage

Server Exports

ExportDescription
getQueryClientReturns a per-request singleton QueryClient for React Server Components
createAugurOptionsCreates server-side query options proxy for prefetching with identical keys to useAugurOptions
getItemPriceKeyQuery key factory for item price queries
getItemPriceOptionsQuery options factory for item price queries
getItemCategoryKeyQuery key factory for item category queries
getItemCategoryOptionsQuery options factory for item category queries
getInvMastKeyQuery key factory for inv-mast queries
getInvMastOptionsQuery options factory for inv-mast queries
getInvMastDocKeyQuery key factory for inv-mast-doc queries
getInvMastDocOptionsQuery options factory for inv-mast-doc queries
getInvMastStockKeyQuery key factory for inv-mast-stock queries
getInvMastStockOptionsQuery options factory for inv-mast-stock queries
getStockKeyQuery key factory for stock queries
getStockOptionsQuery options factory for stock queries
getProductCategoryKeyQuery key factory for product category queries
getProductCategoryOptionsQuery options factory for product category queries
getProductSearchKeyQuery key factory for product search queries
getProductSearchOptionsQuery options factory for product search queries
getSearchSuggestionsKeyQuery key factory for search suggestions queries
getSearchSuggestionsOptionsQuery options factory for search suggestions queries
getItemDetailsKeyQuery key factory for item details queries
getItemDetailsOptionsQuery options factory for item details queries
getItemAttributesKeyQuery key factory for item attributes queries
getItemAttributesOptionsQuery options factory for item attributes queries
getCategoryItemsInfiniteKeyQuery key factory for category items infinite queries
getCategoryItemsInfiniteOptionsQuery options factory for category items infinite queries
getItemSearchInfiniteKeyQuery key factory for item search infinite queries
getItemSearchInfiniteOptionsQuery options factory for item search infinite queries
getCartPricingQueryOptionsQuery options factory for cart pricing queries
getJoomlaContentKeyQuery key factory for Joomla content queries
getJoomlaContentOptionsQuery options factory for Joomla content queries
getJoomlaContentListKeyQuery key factory for Joomla content list queries
getJoomlaContentListOptionsQuery options factory for Joomla content list queries
getJoomlaMenuKeyQuery key factory for Joomla menu queries
getJoomlaMenuOptionsQuery options factory for Joomla menu queries
getJoomlaMenuDocKeyQuery key factory for Joomla menu doc queries
getJoomlaMenuDocOptionsQuery options factory for Joomla menu doc queries
getCustomerOrdersKeyQuery key factory for customer orders queries
getCustomerOrderDetailKeyQuery key factory for order detail queries
getCustomerInvoicesKeyQuery key factory for customer invoices queries
getCustomerInvoiceDetailKeyQuery key factory for invoice detail queries
getCustomerQuotesKeyQuery key factory for customer quotes queries
getCustomerQuoteDetailKeyQuery key factory for quote detail queries
getBatchInvMastDocKeyQuery key factory for batch inv-mast-doc queries
getBatchInvMastDocOptionsQuery options factory for batch inv-mast-doc queries
executeBatchQueryExecutes a batch query that splits large ID lists into chunked parallel requests
stableStringifyDeterministic JSON.stringify for consistent query key serialization

Web Exports

ExportDescription
useIsMobileReturns whether the viewport is below the mobile breakpoint
MobileProviderContext provider that tracks viewport size for mobile detection
useIsHydratedReturns true after client-side hydration is complete
useMobileOptimizedIntersectionIntersectionObserver hook with mobile-optimized thresholds
useImageWithFallbackLoads an image with automatic fallback to a placeholder on error

This page is auto-generated from hooks-manifest.json at build time.