@behio/storefront-sdk 2.29.0 → 2.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.d.mts CHANGED
@@ -357,12 +357,14 @@ interface NewsletterSubscribeInput {
357
357
  source?: string;
358
358
  /** Honeypot: keep empty. A filled value is treated as a bot and ignored. */
359
359
  website?: string;
360
+ /** The consent wording shown to the visitor. Only its hash is stored, as proof. */
361
+ consentText?: string;
360
362
  }
361
363
  interface NewsletterSubscribeResult {
362
364
  success: boolean;
363
365
  /** Confirm the email before the subscription becomes active. */
364
366
  confirmationRequired?: boolean;
365
- /** True when this email was already an active subscriber. */
367
+ /** Always false: the answer never reveals who is on the list. */
366
368
  alreadySubscribed: boolean;
367
369
  }
368
370
  interface NewsletterConfirmResult {
@@ -372,6 +374,8 @@ interface NewsletterConfirmResult {
372
374
  }
373
375
  interface NewsletterUnsubscribeResult {
374
376
  success: boolean;
377
+ /** True for a bare email: its owner gets a signed link, nothing has changed yet. */
378
+ confirmationRequired: boolean;
375
379
  }
376
380
  interface ShopSeo {
377
381
  robotsTxt?: string | null;
@@ -1681,6 +1685,8 @@ interface CheckoutInput {
1681
1685
  termsConsent?: boolean;
1682
1686
  gdprConsent?: boolean;
1683
1687
  newsletterOptIn?: boolean;
1688
+ /** Wording of the newsletter checkbox as the customer saw it. Only its hash is stored, as proof of consent. */
1689
+ newsletterConsentText?: string;
1684
1690
  /**
1685
1691
  * Consent to start delivering digital content (courses, downloads,
1686
1692
  * services) before the withdrawal period ends, which waives the right of
@@ -2553,7 +2559,35 @@ interface StorefrontFaqQuery {
2553
2559
  locale?: string;
2554
2560
  }
2555
2561
  /** Public definition of a form (`GET /forms/{slug}`). */
2562
+ interface StorefrontFormPlacement {
2563
+ key: string;
2564
+ mode: "inline" | "popup";
2565
+ enabled: boolean;
2566
+ delaySeconds: number;
2567
+ dismissDays: number;
2568
+ devices: "all" | "mobile" | "desktop";
2569
+ /** Exact path or prefix ending in *. No regex. */
2570
+ includePaths: string[];
2571
+ excludePaths: string[];
2572
+ }
2573
+ interface StorefrontFormPresentation {
2574
+ purpose: "general" | "newsletter";
2575
+ content: {
2576
+ eyebrow: string;
2577
+ heading: string;
2578
+ body: string;
2579
+ imageUrl: string;
2580
+ imageAlt: string;
2581
+ dismissLabel: string;
2582
+ backgroundColor: string;
2583
+ accentColor: string;
2584
+ };
2585
+ placements: StorefrontFormPlacement[];
2586
+ }
2556
2587
  interface StorefrontForm {
2588
+ /** Published content version. Requires the managed Forms API. */
2589
+ revision: number;
2590
+ presentation: StorefrontFormPresentation;
2557
2591
  slug: string;
2558
2592
  name: string;
2559
2593
  description: string | null;
@@ -2561,6 +2595,8 @@ interface StorefrontForm {
2561
2595
  settings: StorefrontFormSettings;
2562
2596
  }
2563
2597
  interface StorefrontFormSubmitInput {
2598
+ revision?: number;
2599
+ placement?: string;
2564
2600
  /** `{fieldKey: value}`; unknown keys are dropped server-side. */
2565
2601
  data: Record<string, unknown>;
2566
2602
  locale?: string;
@@ -2588,6 +2624,8 @@ interface StorefrontFormFile {
2588
2624
  type: string;
2589
2625
  }
2590
2626
  interface StorefrontFormSubmitResult {
2627
+ confirmationRequired?: boolean;
2628
+ alreadySubscribed?: boolean;
2591
2629
  ok: boolean;
2592
2630
  /** Id of the stored submission (null when the form does not store responses). */
2593
2631
  id: string | null;
@@ -4460,6 +4498,10 @@ declare class BookingsModule {
4460
4498
  declare class FormsModule {
4461
4499
  private client;
4462
4500
  constructor(client: BehioStorefront);
4501
+ /** Only active, published placements. Internal delivery/CRM settings never leave the server. */
4502
+ placements(): Promise<SdkResult<{
4503
+ items: StorefrontForm[];
4504
+ }>>;
4463
4505
  /** Public definition of one form (fields + settings). 404 for an unknown or inactive slug. */
4464
4506
  get(slug: string): Promise<SdkResult<StorefrontForm>>;
4465
4507
  /**
@@ -4659,8 +4701,8 @@ declare class ShippingModule {
4659
4701
  /**
4660
4702
  * First-party newsletter opt-in. Use for the footer signup block and the
4661
4703
  * checkout newsletter checkbox (render its default from
4662
- * `ShopInfo.checkout.newsletterOptInDefault`). Subscribing is idempotent and
4663
- * re-activates a previously unsubscribed email. Pass the hidden `website`
4704
+ * `ShopInfo.checkout.newsletterOptInDefault`). Subscribing is idempotent and the
4705
+ * answer never reveals who is on the list. Pass the hidden `website`
4664
4706
  * honeypot field straight through from your form: a filled value is silently
4665
4707
  * accepted but stored nowhere.
4666
4708
  */
@@ -4669,7 +4711,14 @@ declare class NewsletterModule {
4669
4711
  constructor(client: BehioStorefront);
4670
4712
  subscribe(input: NewsletterSubscribeInput): Promise<SdkResult<NewsletterSubscribeResult>>;
4671
4713
  confirm(token: string): Promise<SdkResult<NewsletterConfirmResult>>;
4714
+ /**
4715
+ * An address proves nothing, so this changes nothing yet: if the address is on
4716
+ * the list, its owner receives a signed link. The answer is the same either way.
4717
+ */
4672
4718
  unsubscribe(email: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
4719
+ /** Unsubscribes at once with the signed token from a newsletter e-mail. */
4720
+ unsubscribeWithToken(token: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
4721
+ private requestUnsubscribe;
4673
4722
  }
4674
4723
 
4675
4724
  interface BehioContextValue {
@@ -5380,11 +5429,16 @@ declare function useAnalyticsEvents(): {
5380
5429
  * Subscribe an email to the shop newsletter (first-party opt-in, GAP-08).
5381
5430
  * Use for the footer signup block; the checkout opt-in checkbox goes through
5382
5431
  * the checkout input's `newsletterOptIn` instead. Subscribing is idempotent
5383
- * and re-activates a previously unsubscribed email.
5432
+ * and the answer never reveals who is on the list.
5384
5433
  */
5385
5434
  declare function useNewsletterSubscribe(): _tanstack_react_query.UseMutationResult<NewsletterSubscribeResult, Error, NewsletterSubscribeInput, unknown>;
5386
- /** Unsubscribe an email from the shop newsletter (idempotent). */
5387
- declare function useNewsletterUnsubscribe(): _tanstack_react_query.UseMutationResult<NewsletterUnsubscribeResult, Error, string, unknown>;
5435
+ /**
5436
+ * Opt-out. An email only sends its owner a signed link; `{token}` from a
5437
+ * newsletter e-mail unsubscribes at once.
5438
+ */
5439
+ declare function useNewsletterUnsubscribe(): _tanstack_react_query.UseMutationResult<NewsletterUnsubscribeResult, Error, string | {
5440
+ token: string;
5441
+ }, unknown>;
5388
5442
  /** Explicit confirmation only. Never call on page load or link prefetch. */
5389
5443
  declare function useNewsletterConfirm(): _tanstack_react_query.UseMutationResult<NewsletterConfirmResult, Error, string, unknown>;
5390
5444
 
@@ -5554,6 +5608,15 @@ declare function useSiteFormSubmit(slug: string): {
5554
5608
  error: SdkError | null;
5555
5609
  reset: () => void;
5556
5610
  };
5611
+ /** SSR initial data avoids fetching first-render configuration in an effect. */
5612
+ declare function useFormPlacements(options?: {
5613
+ initialData?: {
5614
+ items: StorefrontForm[];
5615
+ };
5616
+ enabled?: boolean;
5617
+ }): _tanstack_react_query.UseQueryResult<NoInfer<{
5618
+ items: StorefrontForm[];
5619
+ }>, Error>;
5557
5620
 
5558
5621
  interface UseBookingsOptions {
5559
5622
  enabled?: boolean;
@@ -6336,7 +6399,7 @@ declare function formatPrice(amount: number, currency: string, locale?: string,
6336
6399
  * Consent stays the script layer's job: this helper never loads anything, it
6337
6400
  * only talks to runtimes that already exist on the page.
6338
6401
  */
6339
- type EcommerceEventName = "view_item" | "view_item_list" | "select_item" | "add_to_cart" | "remove_from_cart" | "view_cart" | "add_to_wishlist" | "view_promotion" | "select_promotion" | "begin_checkout" | "add_payment_info" | "add_shipping_info" | "search" | "generate_lead" | "purchase" | "variant_selected" | "newsletter_signup";
6402
+ type EcommerceEventName = "view_item" | "view_item_list" | "select_item" | "add_to_cart" | "remove_from_cart" | "view_cart" | "add_to_wishlist" | "view_promotion" | "select_promotion" | "begin_checkout" | "add_payment_info" | "add_shipping_info" | "search" | "generate_lead" | "purchase" | "variant_selected" | "newsletter_signup" | "newsletter_request" | "form_popup_view";
6340
6403
  type EcommerceItem = {
6341
6404
  item_id: string;
6342
6405
  item_name: string;
@@ -6424,4 +6487,19 @@ declare function revokeAnalyticsConsent(client: BehioStorefront): Promise<SdkRes
6424
6487
  success: boolean;
6425
6488
  }>>;
6426
6489
 
6427
- export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Blog, type BlogPostDetail, type BlogPostListItem, type BlogPostsPage, type BlogPostsQuery, type BlogSettings, type BlogTag, type Booking, type BookingCategory, type BookingConfig, type BookingCreateInput, type BookingCreated, type BookingLocale, type BookingLocation, type BookingManageSlotsQuery, type BookingService, type BookingSlot, type BookingSlots, type BookingSlotsQuery, type BookingStaff, type BookingStatus, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CheckoutPaymentMethod, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type Facet, type FacetRange, type FacetValue, type FacetsResponse, type FilterField, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageAttachment, type PageDetail, type PaginatedResponse, type PaymentInstrument, type PaymentStatus, type PaymentSwift, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductParameter, type ProductParameterGroup, type ProductParametersResponse, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, RichText, type RichTextProps, type ShopInfo, type ShopSeo, type SiteFormField, type SiteFormFieldOption, type SiteFormFieldType, type StorageAdapter, type StorefrontForm, type StorefrontFormFieldError, type StorefrontFormFieldErrorCode, type StorefrontFormSettings, type StorefrontFormSubmitInput, type StorefrontFormSubmitResult, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type SubmitWithdrawalInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseBlogPostOptions, type UseBlogPostsOptions, type UseBlogsOptions, type UseBookingsOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCollectionOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFaqOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductParametersOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSiteFormOptions, type UseSubscriptionsOptions, type UseVisitorMessagesOptions, type VisitorMessage, type WishlistItem, type WithdrawalAcknowledgement, type WithdrawalWindow, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBlogPost, useBlogPosts, useBlogs, useBookingConfig, useBookingSlots, useBundle, useBundles, useCancelBooking, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCheckoutPreview, useCollection, useCollectionItem, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCreateBooking, useCrossSell, useCurrency, useCustomer, useFacets, useFaqGroup, useFaqGroups, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useManagedBooking, useManagedBookingSlots, useMenu, useNewsletterConfirm, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductParameters, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useRescheduleBooking, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSiteForm, useSiteFormSubmit, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubmitWithdrawal, useSubscriptions, useVisitorMessages, useWishlist };
6490
+ type FormPopupOffer = {
6491
+ form: StorefrontForm;
6492
+ placement: StorefrontFormPlacement;
6493
+ };
6494
+ /** One host in the shared shell. Preview never mounts it; no subscription occurs on a timer. */
6495
+ declare function useFormPopup({ forms, locales, pathname }: {
6496
+ forms: StorefrontForm[];
6497
+ locales: string[];
6498
+ pathname: string;
6499
+ }): {
6500
+ active: FormPopupOffer | null;
6501
+ dialog: react.RefObject<HTMLDialogElement | null>;
6502
+ dismiss: () => void;
6503
+ };
6504
+
6505
+ export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Blog, type BlogPostDetail, type BlogPostListItem, type BlogPostsPage, type BlogPostsQuery, type BlogSettings, type BlogTag, type Booking, type BookingCategory, type BookingConfig, type BookingCreateInput, type BookingCreated, type BookingLocale, type BookingLocation, type BookingManageSlotsQuery, type BookingService, type BookingSlot, type BookingSlots, type BookingSlotsQuery, type BookingStaff, type BookingStatus, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CheckoutPaymentMethod, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type Facet, type FacetRange, type FacetValue, type FacetsResponse, type FilterField, type FormPopupOffer, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageAttachment, type PageDetail, type PaginatedResponse, type PaymentInstrument, type PaymentStatus, type PaymentSwift, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductParameter, type ProductParameterGroup, type ProductParametersResponse, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, RichText, type RichTextProps, type ShopInfo, type ShopSeo, type SiteFormField, type SiteFormFieldOption, type SiteFormFieldType, type StorageAdapter, type StorefrontForm, type StorefrontFormFieldError, type StorefrontFormFieldErrorCode, type StorefrontFormSettings, type StorefrontFormSubmitInput, type StorefrontFormSubmitResult, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type SubmitWithdrawalInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseBlogPostOptions, type UseBlogPostsOptions, type UseBlogsOptions, type UseBookingsOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCollectionOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFaqOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductParametersOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSiteFormOptions, type UseSubscriptionsOptions, type UseVisitorMessagesOptions, type VisitorMessage, type WishlistItem, type WithdrawalAcknowledgement, type WithdrawalWindow, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBlogPost, useBlogPosts, useBlogs, useBookingConfig, useBookingSlots, useBundle, useBundles, useCancelBooking, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCheckoutPreview, useCollection, useCollectionItem, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCreateBooking, useCrossSell, useCurrency, useCustomer, useFacets, useFaqGroup, useFaqGroups, useFeatured, useFilters, useFormPlacements, useFormPopup, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useManagedBooking, useManagedBookingSlots, useMenu, useNewsletterConfirm, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductParameters, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useRescheduleBooking, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSiteForm, useSiteFormSubmit, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubmitWithdrawal, useSubscriptions, useVisitorMessages, useWishlist };
package/dist/react.d.ts CHANGED
@@ -357,12 +357,14 @@ interface NewsletterSubscribeInput {
357
357
  source?: string;
358
358
  /** Honeypot: keep empty. A filled value is treated as a bot and ignored. */
359
359
  website?: string;
360
+ /** The consent wording shown to the visitor. Only its hash is stored, as proof. */
361
+ consentText?: string;
360
362
  }
361
363
  interface NewsletterSubscribeResult {
362
364
  success: boolean;
363
365
  /** Confirm the email before the subscription becomes active. */
364
366
  confirmationRequired?: boolean;
365
- /** True when this email was already an active subscriber. */
367
+ /** Always false: the answer never reveals who is on the list. */
366
368
  alreadySubscribed: boolean;
367
369
  }
368
370
  interface NewsletterConfirmResult {
@@ -372,6 +374,8 @@ interface NewsletterConfirmResult {
372
374
  }
373
375
  interface NewsletterUnsubscribeResult {
374
376
  success: boolean;
377
+ /** True for a bare email: its owner gets a signed link, nothing has changed yet. */
378
+ confirmationRequired: boolean;
375
379
  }
376
380
  interface ShopSeo {
377
381
  robotsTxt?: string | null;
@@ -1681,6 +1685,8 @@ interface CheckoutInput {
1681
1685
  termsConsent?: boolean;
1682
1686
  gdprConsent?: boolean;
1683
1687
  newsletterOptIn?: boolean;
1688
+ /** Wording of the newsletter checkbox as the customer saw it. Only its hash is stored, as proof of consent. */
1689
+ newsletterConsentText?: string;
1684
1690
  /**
1685
1691
  * Consent to start delivering digital content (courses, downloads,
1686
1692
  * services) before the withdrawal period ends, which waives the right of
@@ -2553,7 +2559,35 @@ interface StorefrontFaqQuery {
2553
2559
  locale?: string;
2554
2560
  }
2555
2561
  /** Public definition of a form (`GET /forms/{slug}`). */
2562
+ interface StorefrontFormPlacement {
2563
+ key: string;
2564
+ mode: "inline" | "popup";
2565
+ enabled: boolean;
2566
+ delaySeconds: number;
2567
+ dismissDays: number;
2568
+ devices: "all" | "mobile" | "desktop";
2569
+ /** Exact path or prefix ending in *. No regex. */
2570
+ includePaths: string[];
2571
+ excludePaths: string[];
2572
+ }
2573
+ interface StorefrontFormPresentation {
2574
+ purpose: "general" | "newsletter";
2575
+ content: {
2576
+ eyebrow: string;
2577
+ heading: string;
2578
+ body: string;
2579
+ imageUrl: string;
2580
+ imageAlt: string;
2581
+ dismissLabel: string;
2582
+ backgroundColor: string;
2583
+ accentColor: string;
2584
+ };
2585
+ placements: StorefrontFormPlacement[];
2586
+ }
2556
2587
  interface StorefrontForm {
2588
+ /** Published content version. Requires the managed Forms API. */
2589
+ revision: number;
2590
+ presentation: StorefrontFormPresentation;
2557
2591
  slug: string;
2558
2592
  name: string;
2559
2593
  description: string | null;
@@ -2561,6 +2595,8 @@ interface StorefrontForm {
2561
2595
  settings: StorefrontFormSettings;
2562
2596
  }
2563
2597
  interface StorefrontFormSubmitInput {
2598
+ revision?: number;
2599
+ placement?: string;
2564
2600
  /** `{fieldKey: value}`; unknown keys are dropped server-side. */
2565
2601
  data: Record<string, unknown>;
2566
2602
  locale?: string;
@@ -2588,6 +2624,8 @@ interface StorefrontFormFile {
2588
2624
  type: string;
2589
2625
  }
2590
2626
  interface StorefrontFormSubmitResult {
2627
+ confirmationRequired?: boolean;
2628
+ alreadySubscribed?: boolean;
2591
2629
  ok: boolean;
2592
2630
  /** Id of the stored submission (null when the form does not store responses). */
2593
2631
  id: string | null;
@@ -4460,6 +4498,10 @@ declare class BookingsModule {
4460
4498
  declare class FormsModule {
4461
4499
  private client;
4462
4500
  constructor(client: BehioStorefront);
4501
+ /** Only active, published placements. Internal delivery/CRM settings never leave the server. */
4502
+ placements(): Promise<SdkResult<{
4503
+ items: StorefrontForm[];
4504
+ }>>;
4463
4505
  /** Public definition of one form (fields + settings). 404 for an unknown or inactive slug. */
4464
4506
  get(slug: string): Promise<SdkResult<StorefrontForm>>;
4465
4507
  /**
@@ -4659,8 +4701,8 @@ declare class ShippingModule {
4659
4701
  /**
4660
4702
  * First-party newsletter opt-in. Use for the footer signup block and the
4661
4703
  * checkout newsletter checkbox (render its default from
4662
- * `ShopInfo.checkout.newsletterOptInDefault`). Subscribing is idempotent and
4663
- * re-activates a previously unsubscribed email. Pass the hidden `website`
4704
+ * `ShopInfo.checkout.newsletterOptInDefault`). Subscribing is idempotent and the
4705
+ * answer never reveals who is on the list. Pass the hidden `website`
4664
4706
  * honeypot field straight through from your form: a filled value is silently
4665
4707
  * accepted but stored nowhere.
4666
4708
  */
@@ -4669,7 +4711,14 @@ declare class NewsletterModule {
4669
4711
  constructor(client: BehioStorefront);
4670
4712
  subscribe(input: NewsletterSubscribeInput): Promise<SdkResult<NewsletterSubscribeResult>>;
4671
4713
  confirm(token: string): Promise<SdkResult<NewsletterConfirmResult>>;
4714
+ /**
4715
+ * An address proves nothing, so this changes nothing yet: if the address is on
4716
+ * the list, its owner receives a signed link. The answer is the same either way.
4717
+ */
4672
4718
  unsubscribe(email: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
4719
+ /** Unsubscribes at once with the signed token from a newsletter e-mail. */
4720
+ unsubscribeWithToken(token: string): Promise<SdkResult<NewsletterUnsubscribeResult>>;
4721
+ private requestUnsubscribe;
4673
4722
  }
4674
4723
 
4675
4724
  interface BehioContextValue {
@@ -5380,11 +5429,16 @@ declare function useAnalyticsEvents(): {
5380
5429
  * Subscribe an email to the shop newsletter (first-party opt-in, GAP-08).
5381
5430
  * Use for the footer signup block; the checkout opt-in checkbox goes through
5382
5431
  * the checkout input's `newsletterOptIn` instead. Subscribing is idempotent
5383
- * and re-activates a previously unsubscribed email.
5432
+ * and the answer never reveals who is on the list.
5384
5433
  */
5385
5434
  declare function useNewsletterSubscribe(): _tanstack_react_query.UseMutationResult<NewsletterSubscribeResult, Error, NewsletterSubscribeInput, unknown>;
5386
- /** Unsubscribe an email from the shop newsletter (idempotent). */
5387
- declare function useNewsletterUnsubscribe(): _tanstack_react_query.UseMutationResult<NewsletterUnsubscribeResult, Error, string, unknown>;
5435
+ /**
5436
+ * Opt-out. An email only sends its owner a signed link; `{token}` from a
5437
+ * newsletter e-mail unsubscribes at once.
5438
+ */
5439
+ declare function useNewsletterUnsubscribe(): _tanstack_react_query.UseMutationResult<NewsletterUnsubscribeResult, Error, string | {
5440
+ token: string;
5441
+ }, unknown>;
5388
5442
  /** Explicit confirmation only. Never call on page load or link prefetch. */
5389
5443
  declare function useNewsletterConfirm(): _tanstack_react_query.UseMutationResult<NewsletterConfirmResult, Error, string, unknown>;
5390
5444
 
@@ -5554,6 +5608,15 @@ declare function useSiteFormSubmit(slug: string): {
5554
5608
  error: SdkError | null;
5555
5609
  reset: () => void;
5556
5610
  };
5611
+ /** SSR initial data avoids fetching first-render configuration in an effect. */
5612
+ declare function useFormPlacements(options?: {
5613
+ initialData?: {
5614
+ items: StorefrontForm[];
5615
+ };
5616
+ enabled?: boolean;
5617
+ }): _tanstack_react_query.UseQueryResult<NoInfer<{
5618
+ items: StorefrontForm[];
5619
+ }>, Error>;
5557
5620
 
5558
5621
  interface UseBookingsOptions {
5559
5622
  enabled?: boolean;
@@ -6336,7 +6399,7 @@ declare function formatPrice(amount: number, currency: string, locale?: string,
6336
6399
  * Consent stays the script layer's job: this helper never loads anything, it
6337
6400
  * only talks to runtimes that already exist on the page.
6338
6401
  */
6339
- type EcommerceEventName = "view_item" | "view_item_list" | "select_item" | "add_to_cart" | "remove_from_cart" | "view_cart" | "add_to_wishlist" | "view_promotion" | "select_promotion" | "begin_checkout" | "add_payment_info" | "add_shipping_info" | "search" | "generate_lead" | "purchase" | "variant_selected" | "newsletter_signup";
6402
+ type EcommerceEventName = "view_item" | "view_item_list" | "select_item" | "add_to_cart" | "remove_from_cart" | "view_cart" | "add_to_wishlist" | "view_promotion" | "select_promotion" | "begin_checkout" | "add_payment_info" | "add_shipping_info" | "search" | "generate_lead" | "purchase" | "variant_selected" | "newsletter_signup" | "newsletter_request" | "form_popup_view";
6340
6403
  type EcommerceItem = {
6341
6404
  item_id: string;
6342
6405
  item_name: string;
@@ -6424,4 +6487,19 @@ declare function revokeAnalyticsConsent(client: BehioStorefront): Promise<SdkRes
6424
6487
  success: boolean;
6425
6488
  }>>;
6426
6489
 
6427
- export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Blog, type BlogPostDetail, type BlogPostListItem, type BlogPostsPage, type BlogPostsQuery, type BlogSettings, type BlogTag, type Booking, type BookingCategory, type BookingConfig, type BookingCreateInput, type BookingCreated, type BookingLocale, type BookingLocation, type BookingManageSlotsQuery, type BookingService, type BookingSlot, type BookingSlots, type BookingSlotsQuery, type BookingStaff, type BookingStatus, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CheckoutPaymentMethod, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type Facet, type FacetRange, type FacetValue, type FacetsResponse, type FilterField, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageAttachment, type PageDetail, type PaginatedResponse, type PaymentInstrument, type PaymentStatus, type PaymentSwift, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductParameter, type ProductParameterGroup, type ProductParametersResponse, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, RichText, type RichTextProps, type ShopInfo, type ShopSeo, type SiteFormField, type SiteFormFieldOption, type SiteFormFieldType, type StorageAdapter, type StorefrontForm, type StorefrontFormFieldError, type StorefrontFormFieldErrorCode, type StorefrontFormSettings, type StorefrontFormSubmitInput, type StorefrontFormSubmitResult, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type SubmitWithdrawalInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseBlogPostOptions, type UseBlogPostsOptions, type UseBlogsOptions, type UseBookingsOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCollectionOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFaqOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductParametersOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSiteFormOptions, type UseSubscriptionsOptions, type UseVisitorMessagesOptions, type VisitorMessage, type WishlistItem, type WithdrawalAcknowledgement, type WithdrawalWindow, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBlogPost, useBlogPosts, useBlogs, useBookingConfig, useBookingSlots, useBundle, useBundles, useCancelBooking, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCheckoutPreview, useCollection, useCollectionItem, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCreateBooking, useCrossSell, useCurrency, useCustomer, useFacets, useFaqGroup, useFaqGroups, useFeatured, useFilters, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useManagedBooking, useManagedBookingSlots, useMenu, useNewsletterConfirm, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductParameters, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useRescheduleBooking, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSiteForm, useSiteFormSubmit, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubmitWithdrawal, useSubscriptions, useVisitorMessages, useWishlist };
6490
+ type FormPopupOffer = {
6491
+ form: StorefrontForm;
6492
+ placement: StorefrontFormPlacement;
6493
+ };
6494
+ /** One host in the shared shell. Preview never mounts it; no subscription occurs on a timer. */
6495
+ declare function useFormPopup({ forms, locales, pathname }: {
6496
+ forms: StorefrontForm[];
6497
+ locales: string[];
6498
+ pathname: string;
6499
+ }): {
6500
+ active: FormPopupOffer | null;
6501
+ dialog: react.RefObject<HTMLDialogElement | null>;
6502
+ dismiss: () => void;
6503
+ };
6504
+
6505
+ export { type ActivePromotion, type AddToCartInput, type AnalyticsEventInput, type AuthTokens, BehioAnalyticsTracker, BehioApiError, BehioProvider, type BehioProviderProps, type Blog, type BlogPostDetail, type BlogPostListItem, type BlogPostsPage, type BlogPostsQuery, type BlogSettings, type BlogTag, type Booking, type BookingCategory, type BookingConfig, type BookingCreateInput, type BookingCreated, type BookingLocale, type BookingLocation, type BookingManageSlotsQuery, type BookingService, type BookingSlot, type BookingSlots, type BookingSlotsQuery, type BookingStaff, type BookingStatus, type Bundle, type BundleItem, type Cart, type CartDiscount, type CartItem, type Category, type CategoryDetail, type CheckoutAddress, type CheckoutInput, type CheckoutPaymentMethod, type CookieConsent, type CookieConsentInput, type CrossSellItem, CurrencySwitcher, type CurrencySwitcherProps, type CurrencySwitcherRenderProps, type CustomerAddress, type CustomerProfile, type EcommerceEventName, type EcommerceItem, type EcommercePayload, type Facet, type FacetRange, type FacetValue, type FacetsResponse, type FilterField, type FormPopupOffer, type FulfillmentStatus, type GiftCardBalance, type LoginInput, type MessageResponse, type OrderDetail, type OrderItem, type OrderListItem, type OrderStatus, type Page, type PageAttachment, type PageDetail, type PaginatedResponse, type PaymentInstrument, type PaymentStatus, type PaymentSwift, type PersonalOffer, type ProductDetail, type ProductLabel, type ProductListItem, type ProductParameter, type ProductParameterGroup, type ProductParametersResponse, type ProductPrice, type ProductReview, type ProductReviewsResponse, type ProductVariant, type ProductsQuery, type QuoteRequest, type RegisterInput, type ReturnRequest, RichText, type RichTextProps, type ShopInfo, type ShopSeo, type SiteFormField, type SiteFormFieldOption, type SiteFormFieldType, type StorageAdapter, type StorefrontForm, type StorefrontFormFieldError, type StorefrontFormFieldErrorCode, type StorefrontFormSettings, type StorefrontFormSubmitInput, type StorefrontFormSubmitResult, StorefrontScripts, type StorefrontScriptsProps, type SubmitQuoteInput, type SubmitReturnInput, type SubmitReviewInput, type SubmitWithdrawalInput, type UseAddressAutocompleteOptions, type UseAddressAutocompleteReturn, type UseAddressesOptions, type UseBlogPostOptions, type UseBlogPostsOptions, type UseBlogsOptions, type UseBookingsOptions, type UseCartCountOptions, type UseCartOptions, type UseCategoriesOptions, type UseCategoryOptions, type UseCertificateVerificationOptions, type UseCollectionOptions, type UseCourseCertificatesOptions, type UseCourseOptions, type UseCoursesOptions, type UseCurrencyResult, type UseCustomerOptions, type UseFacetsOptions, type UseFaqOptions, type UseFeaturedOptions, type UseFiltersOptions, type UseLabelsOptions, type UseLessonCommentsOptions, type UseLessonNoteOptions, type UseLessonQuizOptions, type UseLessonTutorOptions, type UseLoyaltyOptions, type UseMenuOptions, type UseOrderOptions, type UseOrdersOptions, type UsePageOptions, type UsePagesOptions, type UsePaymentMethodsOptions, type UsePersonalOffersOptions, type UseProductOptions, type UseProductParametersOptions, type UseProductsOptions, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingQuoteOptions, type UseShopInfoOptions, type UseShopScriptsOptions, type UseShopSeoOptions, type UseSiteFormOptions, type UseSubscriptionsOptions, type UseVisitorMessagesOptions, type VisitorMessage, type WishlistItem, type WithdrawalAcknowledgement, type WithdrawalWindow, cookieStorage, createMemoryStorage, detectStorage, formatPrice, generateVisitorId, getStoredVisitorId, grantAnalyticsConsent, localStorageAdapter, memoryStorage, revokeAnalyticsConsent, trackEcommerceEvent, useAddressAutocomplete, useAddresses, useAnalyticsEvents, useAuth, useBehio, useBehioClient, useBlogPost, useBlogPosts, useBlogs, useBookingConfig, useBookingSlots, useBundle, useBundles, useCancelBooking, useCart, useCartCount, useCategories, useCategory, useCertificateVerification, useCheckout, useCheckoutPreview, useCollection, useCollectionItem, useCookieConsent, useCourse, useCourseCertificates, useCourses, useCreateBooking, useCrossSell, useCurrency, useCustomer, useFacets, useFaqGroup, useFaqGroups, useFeatured, useFilters, useFormPlacements, useFormPopup, useGiftCardBalance, useIsInWishlist, useLabels, useLessonComments, useLessonNote, useLessonQuiz, useLessonTutor, useLookupReturnableOrder, useLoyalty, useManagedBooking, useManagedBookingSlots, useMenu, useNewsletterConfirm, useNewsletterSubscribe, useNewsletterUnsubscribe, useNotifyWhenAvailable, useOrder, useOrderAccess, useOrders, usePage, usePages, usePaymentMethods, usePersonalOffers, usePickupPoints, useProduct, useProductGroup, useProductParameters, useProductPromotions, useProductReviews, useProducts, useQuoteStatus, useRescheduleBooking, useReturnStatus, useSearch, useShippingMethods, useShippingQuote, useShopInfo, useShopScripts, useShopSeo, useSiteForm, useSiteFormSubmit, useSubmitQuote, useSubmitReturn, useSubmitReview, useSubmitWithdrawal, useSubscriptions, useVisitorMessages, useWishlist };