@viu/emporix-sdk-react 2.5.0 → 2.6.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/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @viu/emporix-sdk-react
2
2
 
3
+ ## 2.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#92](https://github.com/viuteam/emporix-sdk/pull/92) [`45a2bd8`](https://github.com/viuteam/emporix-sdk/commit/45a2bd8d83cb46d775301790cb2efc60805efc90) Thanks [@amnael1](https://github.com/amnael1)! - Add opt-in reactive customer-token auto-refresh.
8
+
9
+ Core: `EmporixClient.setCustomerTokenRefresher(refresher)` registers a
10
+ single-flight `CustomerTokenRefresher`; on a `customer`-kind 401 the HTTP layer
11
+ refreshes once and retries. Off by default — the customer token stays
12
+ caller-owned.
13
+
14
+ React: `EmporixProvider` gains `autoRefreshCustomerToken` and
15
+ `onCustomerSessionExpired`. When enabled, a customer 401 is transparently
16
+ refreshed via the stored refresh token (anonymous-authorized
17
+ `GET /refreshauthtoken`) and the request is retried; B2B `legalEntityId` is
18
+ preserved.
19
+
20
+ ## 2.5.1
21
+
22
+ ### Patch Changes
23
+
24
+ - [#90](https://github.com/viuteam/emporix-sdk/pull/90) [`3db7978`](https://github.com/viuteam/emporix-sdk/commit/3db79789f90ed8e5134fde809fe689375f03cfa4) Thanks [@amnael1](https://github.com/amnael1)! - Document analytics integration (Google Tag Manager / GA4 ecommerce) via the
25
+ telemetry channel. Adds `docs/analytics.md` — the `dataLayer` bridge, the GA4
26
+ ecommerce event mapping, a `useTrackedCart` wrapper, and SSR + consent notes —
27
+ plus an "Analytics & tracking" pointer in the package README. Docs-only; no API
28
+ changes.
29
+
3
30
  ## 2.5.0
4
31
 
5
32
  ### Minor Changes
package/README.md CHANGED
@@ -82,6 +82,13 @@ call (default: `customer` if a token is stored, else `anonymous`).
82
82
  `prefetchProduct` / `prefetchCart` for server-side hydration. See
83
83
  [`../../docs/react.md`](../../docs/react.md).
84
84
 
85
+ ## Analytics & tracking
86
+
87
+ A typed, no-op-by-default telemetry channel (`onTelemetry` + `useEmporixTelemetry`)
88
+ feeds any analytics sink. For Google Tag Manager / GA4 ecommerce — the `dataLayer`
89
+ bridge, GA4 event mapping, a `useTrackedCart` wrapper, SSR + consent — see
90
+ [`../../docs/analytics.md`](../../docs/analytics.md).
91
+
85
92
  ## Subpath exports
86
93
 
87
94
  `.`, `./provider`, `./hooks`, `./storage`, `./ssr`.
@@ -1,4 +1,4 @@
1
- import { useEmporix, EmporixSiteContext, useActiveCompany } from './chunk-D43CSHK3.js';
1
+ import { useEmporix, EmporixSiteContext, useActiveCompany } from './chunk-SDRV73LG.js';
2
2
  import { useContext, useState, useEffect, useCallback } from 'react';
3
3
  import { useQueryClient, useQuery, useMutation, useInfiniteQuery } from '@tanstack/react-query';
4
4
  import { auth, EmporixError } from '@viu/emporix-sdk';
@@ -1420,5 +1420,5 @@ function useUpdateApproval() {
1420
1420
  }
1421
1421
 
1422
1422
  export { useActiveCart, useAddToShoppingList, useAddressMutations, useApproval, useApprovals, useAssignContact, useAvailabilities, useAvailability, useCancelOrder, useCart, useCartMutations, useCategories, useCategoriesInfinite, useCategory, useCategoryTree, useChangePassword, useCheckout, useCompany, useCompanyContacts, useCompanyGroups, useCompanyLocations, useCompanySwitcher, useCreateApproval, useCreateCart, useCreateCompany, useCreateLocation, useCreateReturn, useCreateShoppingList, useCustomerAddresses, useCustomerSession, useDefaultSite, useDeleteCompany, useDeleteLocation, useDeleteShoppingList, useMatchPrices, useMatchPricesChunked, useMyCompanies, useMyOrders, useMyOrdersInfinite, useMyReturns, useMyRewardPoints, useMyRewardPointsSummary, useMySegmentCategories, useMySegmentCategoriesInfinite, useMySegmentCategoryTree, useMySegmentItems, useMySegmentProducts, useMySegmentProductsInfinite, useMySegments, useOrder, useOrderTransition, usePasswordReset, usePaymentModes, useProduct, useProductByCode, useProductMedia, useProductSearch, useProducts, useProductsByCodes, useProductsInCategory, useProductsInCategoryInfinite, useProductsInfinite, useRedeemCoupon, useRedeemOptions, useRedeemRewardPoints, useRemoveFromShoppingList, useReorder, useReturn, useSalesOrder, useSetShoppingListItemQuantity, useShoppingLists, useSiteContext, useSites, useUnassignContact, useUpdateApproval, useUpdateCompany, useUpdateContactAssignment, useUpdateCustomer, useUpdateLocation, useUpdateSalesOrder, useValidateCoupon, useVariantChildren };
1423
- //# sourceMappingURL=chunk-QMBRDYLW.js.map
1424
- //# sourceMappingURL=chunk-QMBRDYLW.js.map
1423
+ //# sourceMappingURL=chunk-RCI7242Y.js.map
1424
+ //# sourceMappingURL=chunk-RCI7242Y.js.map