Wix Business Solution Contexts
Contexts that Wix business solutions (Stores, Blog, Bookings, Events) already provide on Studio Two sites. Read one of these instead of building a provider that fetches or collects the same data — the data is already on the page, and the Wix SDK is not the way to get it.
Types and descriptions come from the installed @wix/* packages. Open the file for the context you need; it lists every hook, its import specifier, and the properties it returns. A context with a long property list is split across numbered files, all linked in the table.
Rules
- Import only the hook, from the specifier listed here. The specifier is the package path, such as
@wix/stores/context/product. Never guess one; copy it from the vertical's file. - A hook works only inside the area that provides its context — a page the business solution sets up, a Data Source the Wix user attached, or an item in a list. Anywhere else it throws (see When the Hook Throws).
- Connecting an element to business-solution data ("bind the slider's items to my store products") means reading the vertical's hook (
@wix/stores/context/product-listfor a product list). Never fetch it with the Wix SDK (productsV3.queryProducts(),posts.queryPosts()) in a provider or component: Manage Data and Manage Items work only on a context or Data Source, so an SDK fetch makes Manage Data open Code Mode, Manage Items do nothing, and the element render empty. - Consume it in an Editor React component or in a provider you write, as in Importing a Context in Code. A native element reads the vertical's values through Editor Binding instead.
- The business solution must be installed on the site (Wix Stores for
@wix/stores/...). Check the site's installed apps first. If the solution is missing, tell the user to install it and stop. If the platform rejects the code withMissing dependencies: <id> (@wix/stores/context/<name>) for app <id>, do not retry, rewrite or delete the context: name the missing dependency in your final message. - A specifier exists only from the package version that added it. Before importing, make sure
package.jsonandnode_modules/@wix/<vertical>are on the latest version (npm install @wix/<vertical>@latest), and confirm:grep '"./context/<name>"' node_modules/@wix/<vertical>/package.json. Never put// @ts-ignoreabove these imports.TS2307 Cannot find module '@wix/<vertical>/context/<name>'means the package is too old: upgrade it, never fall back to an SDK fetch. - Blog renamed
post-itemtopost-list-item(hookusePostListItemContext) by@wix/blog1.0.708, and addedpost-by-slug, whoseusePostBySlugContextreturns the same properties asusePostContext. Use the new names. - A hook listed with
optional: truealso has a no-argument form. The package's own examples calluseServiceContext(), which returns the value and throws outside its area;optional: truereturnsnullinstead. Read the installed.d.tsfor the exact overloads. - If the vertical's context already holds the field, do not add a settings panel, a data field or an SDK call to collect it again.
Index
| Vertical | Specifier | Hooks | Files |
|---|---|---|---|
| Stores | @wix/stores/context/category-by-id |
useCategoryByIdContext |
category-by-id.md |
| Stores | @wix/stores/context/category-by-slug |
useCategoryBySlugContext |
category-by-slug.md |
| Stores | @wix/stores/context/category-info |
useCategoryInfoContext |
category-info.md |
| Stores | @wix/stores/context/category-list |
useCategoryListContext |
category-list.md |
| Stores | @wix/stores/context/product-by-id |
useProductByIdContext |
product-by-id.md, product-by-id-2.md, product-by-id-3.md, product-by-id-4.md, product-by-id-5.md, product-by-id-6.md |
| Stores | @wix/stores/context/product-by-slug |
useProductBySlugContext |
product-by-slug.md, product-by-slug-2.md |
| Stores | @wix/stores/context/product-item |
useProductItemContext, useProductItemContextValue |
product-item.md, product-item-2.md, product-item-3.md |
| Stores | @wix/stores/context/product-list |
useProductListContext |
product-list.md, product-list-2.md, product-list-3.md |
| Stores | @wix/stores/context/product |
useProductContext |
product.md, product-2.md |
| Stores | @wix/stores/context/promotion-item |
usePromotionItemContext |
promotion-item.md |
| Blog | @wix/blog/context/blog-feed |
useBlogFeedContext |
blog-feed.md, blog-feed-2.md |
| Blog | @wix/blog/context/category-item |
useCategoryItemContext |
category-item.md |
| Blog | @wix/blog/context/post-by-id |
usePostByIdContext |
post-by-id.md, post-by-id-2.md |
| Blog | @wix/blog/context/post-list-item |
usePostListItemContext |
post-list-item.md |
| Blog | @wix/blog/context/post-by-slug |
usePostBySlugContext (same properties as usePostContext) |
post.md |
| Blog | @wix/blog/context/post |
usePostContext |
post.md |
| Blog | @wix/blog/context/related-posts |
useRelatedPostsContext |
related-posts.md |
| Blog | @wix/blog/context/tag-item |
useTagItemContext |
tag-item.md |
| Bookings | @wix/bookings/context/booking-checkout |
useBookingCheckoutContext |
booking-checkout.md |
| Bookings | @wix/bookings/context/categories |
useCategoriesContext |
categories.md |
| Bookings | @wix/bookings/context/locations |
useLocationsContext |
locations.md |
| Bookings | @wix/bookings/context/service-addons |
useServiceAddOnsContext |
service-addons.md |
| Bookings | @wix/bookings/context/service |
useServiceContext |
service.md, service-2.md, service-3.md, service-4.md, service-5.md |
| Bookings | @wix/bookings/context/time-slots |
useTimeSlotsContext |
time-slots.md, time-slots-2.md, time-slots-3.md |
| Bookings | @wix/bookings/context/services |
useServicesContext |
services.md |
| Events | @wix/events/context/event-by-id |
useEventByIdContext |
event-by-id.md, event-by-id-2.md, event-by-id-3.md, event-by-id-4.md, event-by-id-5.md, event-by-id-6.md |
| Events | @wix/events/context/event-by-slug |
useEventBySlugContext |
event-by-slug.md, event-by-slug-2.md, event-by-slug-3.md |
| Events | @wix/events/context/event-item |
useEventItemContext |
event-item.md, event-item-2.md, event-item-3.md |
| Events | @wix/events/context/event-list |
useEventListContext |
event-list.md |
| Events | @wix/events/context/registration |
useRegistrationContext |
registration.md |
| Events | @wix/events/context/event |
useEventContext |
event.md, event-2.md, event-3.md |
| Events | @wix/events/context/seating |
useSeatingContext |
seating.md |
| Events | @wix/events/context/thank-you |
useThankYouContext |
thank-you.md, thank-you-2.md, thank-you-3.md, thank-you-4.md |