@wpappointments/data
Data layer package providing React hooks, API functions, type registry, and utilities for building WP Appointments addons.
Installation
npm install @wpappointments/dataExports
| Category | Exports |
|---|---|
| Hooks | useBookableEntities, useBookableEntity, useBookableVariants, useEffectiveAvailability, useSlideout |
| API | fetchBookables, createBookable, updateBookable, deleteBookable, fetchVariants, fetchVariantAvailability, fetchBookableTypes |
| Registry | registerBookableType, getBookableType, getRegisteredBookableTypes |
| Types | BookableEntity, BookableVariant, BookableAttribute, AvailabilityData, BookableTypeInfo |
| Utilities | apiFetch, toast, randomId, resolve, slideoutContent |
Guides
- Getting Started — setup and first hook
- Hooks — React hooks for data fetching
- API Client — direct API functions
- Registry — bookable type registration on the JS side