bitsnap-react 1.8.0 → 1.9.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.
Files changed (124) hide show
  1. package/README.md +130 -0
  2. package/dist/CartProvider-XWTLBIZ5.js +2 -0
  3. package/dist/CartProvider-XWTLBIZ5.js.map +1 -0
  4. package/dist/CartProvider-ZURLJNBW.mjs +2 -0
  5. package/dist/analytics.d.mts +28 -0
  6. package/dist/analytics.d.ts +28 -0
  7. package/dist/analytics.js +2 -0
  8. package/dist/analytics.js.map +1 -0
  9. package/dist/analytics.mjs +2 -0
  10. package/dist/catalog.d.mts +14 -1
  11. package/dist/catalog.d.ts +14 -1
  12. package/dist/catalog.js +1 -1
  13. package/dist/catalog.js.map +1 -1
  14. package/dist/catalog.mjs +1 -1
  15. package/dist/chunk-3IMJALBX.js +2 -0
  16. package/dist/chunk-3IMJALBX.js.map +1 -0
  17. package/dist/chunk-3UHPJ6NK.js +2 -0
  18. package/dist/chunk-3UHPJ6NK.js.map +1 -0
  19. package/dist/chunk-CO2P4FR5.js +2 -0
  20. package/dist/chunk-CO2P4FR5.js.map +1 -0
  21. package/dist/chunk-E6QVQEGZ.mjs +2 -0
  22. package/dist/chunk-E6QVQEGZ.mjs.map +1 -0
  23. package/dist/{chunk-WRCXZMKK.js → chunk-FHDFLSPW.js} +2 -2
  24. package/dist/chunk-FHDFLSPW.js.map +1 -0
  25. package/dist/chunk-GN63ITLA.mjs +2 -0
  26. package/dist/{chunk-OJT3YO2R.mjs.map → chunk-GN63ITLA.mjs.map} +1 -1
  27. package/dist/chunk-HKVMSMDF.mjs +2 -0
  28. package/dist/chunk-HKVMSMDF.mjs.map +1 -0
  29. package/dist/chunk-JSDGZ4NY.js.map +1 -1
  30. package/dist/chunk-KG6RU37U.js +4 -0
  31. package/dist/chunk-KG6RU37U.js.map +1 -0
  32. package/dist/chunk-KOYBZORL.js.map +1 -1
  33. package/dist/chunk-LJWS6ZRJ.mjs +2 -0
  34. package/dist/chunk-LJWS6ZRJ.mjs.map +1 -0
  35. package/dist/chunk-LZE2E4TE.mjs +4 -0
  36. package/dist/chunk-LZE2E4TE.mjs.map +1 -0
  37. package/dist/chunk-QZJGNLCZ.js +2 -0
  38. package/dist/chunk-QZJGNLCZ.js.map +1 -0
  39. package/dist/chunk-RA452LXZ.mjs +2 -0
  40. package/dist/chunk-RA452LXZ.mjs.map +1 -0
  41. package/dist/chunk-SLLBTQTW.mjs +2 -0
  42. package/dist/chunk-SLLBTQTW.mjs.map +1 -0
  43. package/dist/chunk-SZ256RCC.mjs +2 -0
  44. package/dist/chunk-SZ256RCC.mjs.map +1 -0
  45. package/dist/chunk-V4U2PTKN.js +2 -0
  46. package/dist/chunk-V4U2PTKN.js.map +1 -0
  47. package/dist/chunk-VM6JEJFZ.js +2 -0
  48. package/dist/chunk-VM6JEJFZ.js.map +1 -0
  49. package/dist/{chunk-T2POA6RW.js → chunk-VXB7LA4E.js} +2 -2
  50. package/dist/chunk-VXB7LA4E.js.map +1 -0
  51. package/dist/chunk-XVQKEGPO.mjs +2 -0
  52. package/dist/chunk-XVQKEGPO.mjs.map +1 -0
  53. package/dist/consent.d.mts +158 -0
  54. package/dist/consent.d.ts +158 -0
  55. package/dist/consent.js +75 -0
  56. package/dist/consent.js.map +1 -0
  57. package/dist/consent.mjs +75 -0
  58. package/dist/consent.mjs.map +1 -0
  59. package/dist/course.d.mts +13 -3
  60. package/dist/course.d.ts +13 -3
  61. package/dist/course.js +1 -1
  62. package/dist/course.js.map +1 -1
  63. package/dist/course.mjs +1 -1
  64. package/dist/course.mjs.map +1 -1
  65. package/dist/embed/analytics.js +1 -0
  66. package/dist/embed/consent.js +74 -0
  67. package/dist/errors.js.map +1 -1
  68. package/dist/index.css +1 -1
  69. package/dist/index.css.map +1 -1
  70. package/dist/index.d.mts +54 -7
  71. package/dist/index.d.ts +54 -7
  72. package/dist/index.js +1 -1
  73. package/dist/index.js.map +1 -1
  74. package/dist/index.mjs +1 -1
  75. package/dist/index.mjs.map +1 -1
  76. package/dist/instrument-C_abZLHk.d.mts +912 -0
  77. package/dist/instrument-C_abZLHk.d.ts +912 -0
  78. package/dist/internal.js.map +1 -1
  79. package/dist/methods-CYARZTYL.mjs +2 -0
  80. package/dist/methods-CYARZTYL.mjs.map +1 -0
  81. package/dist/methods-DAPEWVI6.js +2 -0
  82. package/dist/methods-DAPEWVI6.js.map +1 -0
  83. package/dist/models.js.map +1 -1
  84. package/dist/returns.d.mts +9 -1
  85. package/dist/returns.d.ts +9 -1
  86. package/dist/returns.js +1 -1
  87. package/dist/returns.js.map +1 -1
  88. package/dist/returns.mjs +1 -1
  89. package/dist/{types-BTm_ZolC.d.ts → types-BaqLJYuq.d.ts} +13 -0
  90. package/dist/{types-PSBBDdQm.d.mts → types-D_WnqwR_.d.mts} +13 -0
  91. package/package.json +46 -45
  92. package/dist/CartProvider-5KAG5QGA.mjs +0 -2
  93. package/dist/CartProvider-7GJXW2IP.js +0 -2
  94. package/dist/CartProvider-7GJXW2IP.js.map +0 -1
  95. package/dist/chunk-45AP7UZE.mjs +0 -2
  96. package/dist/chunk-45AP7UZE.mjs.map +0 -1
  97. package/dist/chunk-7XTDFTQU.js +0 -4
  98. package/dist/chunk-7XTDFTQU.js.map +0 -1
  99. package/dist/chunk-C6Z7LOHB.mjs +0 -2
  100. package/dist/chunk-C6Z7LOHB.mjs.map +0 -1
  101. package/dist/chunk-HB6KQT26.mjs +0 -4
  102. package/dist/chunk-HB6KQT26.mjs.map +0 -1
  103. package/dist/chunk-LWK4E5G5.js +0 -2
  104. package/dist/chunk-LWK4E5G5.js.map +0 -1
  105. package/dist/chunk-OJT3YO2R.mjs +0 -2
  106. package/dist/chunk-OUYRKNZJ.mjs +0 -2
  107. package/dist/chunk-OUYRKNZJ.mjs.map +0 -1
  108. package/dist/chunk-P2YB25KZ.js +0 -2
  109. package/dist/chunk-P2YB25KZ.js.map +0 -1
  110. package/dist/chunk-T2POA6RW.js.map +0 -1
  111. package/dist/chunk-VPKE2ZOR.mjs +0 -2
  112. package/dist/chunk-VPKE2ZOR.mjs.map +0 -1
  113. package/dist/chunk-WRCXZMKK.js.map +0 -1
  114. package/dist/chunk-WSM4OM72.mjs +0 -2
  115. package/dist/chunk-WSM4OM72.mjs.map +0 -1
  116. package/dist/chunk-XRNTUSBH.js +0 -2
  117. package/dist/chunk-XRNTUSBH.js.map +0 -1
  118. package/dist/chunk-Z2BKIX6F.js +0 -2
  119. package/dist/chunk-Z2BKIX6F.js.map +0 -1
  120. package/dist/methods-ITD6WFIY.mjs +0 -2
  121. package/dist/methods-JENIGNF7.js +0 -2
  122. package/dist/methods-JENIGNF7.js.map +0 -1
  123. /package/dist/{CartProvider-5KAG5QGA.mjs.map → CartProvider-ZURLJNBW.mjs.map} +0 -0
  124. /package/dist/{methods-ITD6WFIY.mjs.map → analytics.mjs.map} +0 -0
package/dist/index.d.mts CHANGED
@@ -1,12 +1,13 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { A as AnalyticsOption, l as Instrument } from './instrument-C_abZLHk.mjs';
2
3
  import { S as SlotAppearance, A as AppearanceElements } from './appearance-core-Dt2grZdl.mjs';
3
4
  export { PRODUCT_LIST_SLOT_NAMES, ProductList, ProductListAppearance, ProductListAppearanceElements, ProductListAppearanceTokens, ProductListData, ProductListItemContext, ProductListProps, ProductListSlotAppearance, ProductListSlotName, ProductListTextKey, ProductListTexts, ProductListTheme, PublicListProduct, UseProductsOptions, UseProductsResult, formatProductPrice, useProducts } from './catalog.mjs';
4
5
  export { BitsnapReturns, BitsnapReturnsProps, BitsnapReturnsProvider, BitsnapReturnsProviderProps, CreateReturnInput, Environment, LegacyCreateReturnInput, LegacyReturnsTexts, LegacyReturnsTheme, ReturnsAppearanceProvider, ReturnsChallenge, ReturnsCodeStep, ReturnsCodeStepProps, ReturnsConfirmation, ReturnsConfirmationProps, ReturnsEmailStep, ReturnsEmailStepProps, ReturnsEnvironment, ReturnsEnvironmentInput, ReturnsMyReturnDetail, ReturnsMyReturnDetailProps, ReturnsMyReturnsList, ReturnsMyReturnsListProps, ReturnsOrderDetail, ReturnsOrderDetailProps, ReturnsOrderList, ReturnsOrderListProps, ReturnsProvider, ReturnsProviderProps, ReturnsResult, ReturnsResultProps, ReturnsSessionStatus, ReturnsTextsInput, SelectedReturnLine, UseCreateReturnResult, UseMyReturnResult, UseMyReturnsResult, UseReturnOrdersResult, UseReturnSessionResult, UseReturnableOrderResult, useCreateReturn, useMyReturn, useMyReturns, useReturnOrders, useReturnSession, useReturnableOrder, useReturnsAppearance, useReturnsSlot, useReturnsText } from './returns.mjs';
5
6
  export { b as RETURNS_SLOT_NAMES, R as ReturnsAppearance, c as ReturnsAppearanceElements, d as ReturnsAppearanceTokens, e as ReturnsSlotAppearance, f as ReturnsSlotName, h as ReturnsTextKey, a as ReturnsTexts, g as ReturnsTheme } from './texts-tQtAGJCT.mjs';
6
7
  import { ReactNode } from 'react';
7
8
  import z__default from 'zod';
8
- import { P as PanelProps, G as GetThemeOutput } from './types-PSBBDdQm.mjs';
9
- export { a as PanelLoginProps, b as PanelScreen, c as PanelSearchParamsType } from './types-PSBBDdQm.mjs';
9
+ import { P as PanelProps, G as GetThemeOutput } from './types-D_WnqwR_.mjs';
10
+ export { a as PanelLoginProps, b as PanelScreen, c as PanelSearchParamsType } from './types-D_WnqwR_.mjs';
10
11
  import './models.mjs';
11
12
  import '@bufbuild/protobuf/wkt';
12
13
  import '@bufbuild/protobuf';
@@ -34,6 +35,12 @@ type Props$3 = {
34
35
  };
35
36
  }[];
36
37
  onClick?: () => Promise<void>;
38
+ /**
39
+ * Usage statistics for your Bitsnap dashboard (Apple Pay clicks and
40
+ * results). On by default; `false` turns it off. Inside `<BitsnapCheckout>`
41
+ * the checkout's setting applies unless this is given.
42
+ */
43
+ analytics?: AnalyticsOption;
37
44
  };
38
45
  declare function Wrapper$2(props: Props$3): react_jsx_runtime.JSX.Element;
39
46
 
@@ -146,8 +153,15 @@ type BitsnapCartProps = {
146
153
  * whatever the locale; omitted keys keep the `pl`/`en` defaults.
147
154
  */
148
155
  texts?: Partial<CheckoutTexts>;
156
+ /**
157
+ * Usage statistics for your Bitsnap dashboard (cart opened, checkout
158
+ * started, add to cart). On by default; `false` turns it off. An object
159
+ * lets you forward every event: `{ onEvent }`. Nothing is stored on the
160
+ * visitor's device.
161
+ */
162
+ analytics?: AnalyticsOption;
149
163
  };
150
- declare function BitsnapCart({ projectID, locale, children, onVisibleChange, className, numberOfProductsInCartOptions, appearance, texts, }: BitsnapCartProps): react_jsx_runtime.JSX.Element;
164
+ declare function BitsnapCart({ projectID, locale, children, onVisibleChange, className, numberOfProductsInCartOptions, appearance, texts, analytics, }: BitsnapCartProps): react_jsx_runtime.JSX.Element;
151
165
 
152
166
  type Props$2 = {
153
167
  test?: boolean;
@@ -166,6 +180,12 @@ type Props$2 = {
166
180
  [key: string]: string | undefined;
167
181
  };
168
182
  }[];
183
+ /**
184
+ * Usage statistics for your Bitsnap dashboard. On by default; `false` turns
185
+ * it off. Inside `<BitsnapCheckout>` the checkout's setting applies unless
186
+ * this is given.
187
+ */
188
+ analytics?: AnalyticsOption;
169
189
  };
170
190
  declare function Wrapper$1(props: Props$2): react_jsx_runtime.JSX.Element;
171
191
 
@@ -299,10 +319,21 @@ interface NotificationsComponentPublicProps {
299
319
  * Custom CSS class names for various component sections (for easier styling).
300
320
  */
301
321
  className?: ComponentClassNames;
322
+ /**
323
+ * Public project ID used for usage statistics. Defaults to the one set by
324
+ * `<BitsnapCheckout projectID>`.
325
+ */
326
+ projectID?: string;
327
+ /**
328
+ * Usage statistics for your Bitsnap dashboard (sign-ups). On by default;
329
+ * `false` turns it off. An object lets you forward every event:
330
+ * `{ onEvent }`. Nothing is stored on the visitor's device.
331
+ */
332
+ analytics?: AnalyticsOption;
302
333
  }
303
334
 
304
335
  type Props$1 = NotificationsComponentPublicProps;
305
- declare function Wrapper({ slug, userID, productID, projectName, projectLogo, projectLogoDark, groups, isManaging, texts, showQRCode, showPhoneInput, hiddenGroupIds, className, }: Props$1): react_jsx_runtime.JSX.Element;
336
+ declare function Wrapper({ slug, userID, productID, projectID, analytics, projectName, projectLogo, projectLogoDark, groups, isManaging, texts, showQRCode, showPhoneInput, hiddenGroupIds, className, }: Props$1): react_jsx_runtime.JSX.Element;
306
337
 
307
338
  type ErrTypes = "internal" | "badInput" | "notFound";
308
339
  type Err = {
@@ -414,6 +445,8 @@ declare namespace Bitsnap {
414
445
  name?: string;
415
446
  price?: number;
416
447
  currency?: string;
448
+ /** Where `add_to_cart` is reported. Defaults to the mounted `<BitsnapCheckout>`. */
449
+ analytics?: Instrument;
417
450
  }): Promise<Err | undefined>;
418
451
  function showCart(): void;
419
452
  function hideCart(): void;
@@ -431,15 +464,22 @@ declare function createCheckout(request: LinkRequest & {
431
464
  declare function getReferenceIfPossible(): string | undefined;
432
465
  declare function injectReferenceToRequestIfNeeded(request: LinkRequest): LinkRequest;
433
466
 
434
- declare const PanelLogin: () => react_jsx_runtime.JSX.Element;
467
+ declare const PanelLogin: ({ analytics, }?: {
468
+ analytics?: AnalyticsOption;
469
+ }) => react_jsx_runtime.JSX.Element;
435
470
 
436
- declare const PanelPage: ({ returnsAppearance, returnsTexts, }?: Pick<PanelProps, "returnsAppearance" | "returnsTexts">) => react_jsx_runtime.JSX.Element;
471
+ declare const PanelPage: ({ returnsAppearance, returnsTexts, analytics, }?: Pick<PanelProps, "returnsAppearance" | "returnsTexts" | "analytics">) => react_jsx_runtime.JSX.Element;
437
472
 
438
473
  interface Props {
439
474
  orderID: string;
440
475
  initialEmail?: string;
441
476
  accessToken?: string;
442
477
  onBack?: () => void;
478
+ /**
479
+ * Usage statistics for your Bitsnap dashboard (order viewed). Inside
480
+ * `<Panel>` or `<PanelProvider>` their setting applies unless this is given.
481
+ */
482
+ analytics?: AnalyticsOption;
443
483
  }
444
484
  declare function PublicOrderPage(props: Props): react_jsx_runtime.JSX.Element;
445
485
 
@@ -461,6 +501,13 @@ declare function getAllowedReturnOrigins(): string[];
461
501
 
462
502
  declare const PanelProvider: React.FC<{
463
503
  children: React.ReactNode;
504
+ /**
505
+ * Usage statistics for your Bitsnap dashboard (panel logins, orders viewed,
506
+ * downloads, course progress). On by default; `false` turns it off. An
507
+ * object lets you forward every event: `{ onEvent }`. Nothing is stored on
508
+ * the visitor's device.
509
+ */
510
+ analytics?: AnalyticsOption;
464
511
  }>;
465
512
  declare const usePanelConfig: () => PanelConfig;
466
513
 
@@ -469,4 +516,4 @@ declare function persistReturnURL(returnURL: string | null): void;
469
516
  declare function readPersistedReturnURL(): string | null;
470
517
  declare function buildAccessTokenRedirect(returnURL: string, accessToken: string): string;
471
518
 
472
- export { Wrapper$2 as ApplePayButton, type Props$3 as ApplePayButtonProps, Bitsnap, type BitsnapCartProps, BitsnapCart as BitsnapCheckout, CHECKOUT_SLOT_NAMES, type CheckoutAppearance, type CheckoutAppearanceElements, type CheckoutAppearanceTokens, type CheckoutSlotAppearance, type CheckoutSlotName, type CheckoutTexts, type CheckoutTheme, type ComponentClassNames, type CustomizationTexts, GetThemeOutput, Wrapper$1 as GooglePayButton, type Props$2 as GooglePayButtonProps, type LinkRequest, type NotificationGroup, Wrapper as NotificationsComponent, type Props$1 as NotificationsComponentProps, type NotificationsComponentPublicProps, PanelPage as Panel, type PanelConfig, PanelLogin, PanelProps, PanelProvider, type PublicNotificationGroup, PublicOrderPage, buildAccessTokenRedirect, createCheckout, createPaymentURL, getAllowedReturnOrigins, getLocale, getPanelConfig, getReferenceIfPossible, getReturnURLFromSearch, injectReferenceToRequestIfNeeded, persistReturnURL, readPersistedReturnURL, setAllowedReturnOrigins, setCustomHost, setHost, setLocale, setLoginURL, setPanelConfig, setProjectID as setPanelProjectID, setProjectID$1 as setProjectID, setTheme, usePanelConfig };
519
+ export { AnalyticsOption, Wrapper$2 as ApplePayButton, type Props$3 as ApplePayButtonProps, Bitsnap, type BitsnapCartProps, BitsnapCart as BitsnapCheckout, CHECKOUT_SLOT_NAMES, type CheckoutAppearance, type CheckoutAppearanceElements, type CheckoutAppearanceTokens, type CheckoutSlotAppearance, type CheckoutSlotName, type CheckoutTexts, type CheckoutTheme, type ComponentClassNames, type CustomizationTexts, GetThemeOutput, Wrapper$1 as GooglePayButton, type Props$2 as GooglePayButtonProps, type LinkRequest, type NotificationGroup, Wrapper as NotificationsComponent, type Props$1 as NotificationsComponentProps, type NotificationsComponentPublicProps, PanelPage as Panel, type PanelConfig, PanelLogin, PanelProps, PanelProvider, type PublicNotificationGroup, PublicOrderPage, buildAccessTokenRedirect, createCheckout, createPaymentURL, getAllowedReturnOrigins, getLocale, getPanelConfig, getReferenceIfPossible, getReturnURLFromSearch, injectReferenceToRequestIfNeeded, persistReturnURL, readPersistedReturnURL, setAllowedReturnOrigins, setCustomHost, setHost, setLocale, setLoginURL, setPanelConfig, setProjectID as setPanelProjectID, setProjectID$1 as setProjectID, setTheme, usePanelConfig };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { A as AnalyticsOption, l as Instrument } from './instrument-C_abZLHk.js';
2
3
  import { S as SlotAppearance, A as AppearanceElements } from './appearance-core-Dt2grZdl.js';
3
4
  export { PRODUCT_LIST_SLOT_NAMES, ProductList, ProductListAppearance, ProductListAppearanceElements, ProductListAppearanceTokens, ProductListData, ProductListItemContext, ProductListProps, ProductListSlotAppearance, ProductListSlotName, ProductListTextKey, ProductListTexts, ProductListTheme, PublicListProduct, UseProductsOptions, UseProductsResult, formatProductPrice, useProducts } from './catalog.js';
4
5
  export { BitsnapReturns, BitsnapReturnsProps, BitsnapReturnsProvider, BitsnapReturnsProviderProps, CreateReturnInput, Environment, LegacyCreateReturnInput, LegacyReturnsTexts, LegacyReturnsTheme, ReturnsAppearanceProvider, ReturnsChallenge, ReturnsCodeStep, ReturnsCodeStepProps, ReturnsConfirmation, ReturnsConfirmationProps, ReturnsEmailStep, ReturnsEmailStepProps, ReturnsEnvironment, ReturnsEnvironmentInput, ReturnsMyReturnDetail, ReturnsMyReturnDetailProps, ReturnsMyReturnsList, ReturnsMyReturnsListProps, ReturnsOrderDetail, ReturnsOrderDetailProps, ReturnsOrderList, ReturnsOrderListProps, ReturnsProvider, ReturnsProviderProps, ReturnsResult, ReturnsResultProps, ReturnsSessionStatus, ReturnsTextsInput, SelectedReturnLine, UseCreateReturnResult, UseMyReturnResult, UseMyReturnsResult, UseReturnOrdersResult, UseReturnSessionResult, UseReturnableOrderResult, useCreateReturn, useMyReturn, useMyReturns, useReturnOrders, useReturnSession, useReturnableOrder, useReturnsAppearance, useReturnsSlot, useReturnsText } from './returns.js';
5
6
  export { b as RETURNS_SLOT_NAMES, R as ReturnsAppearance, c as ReturnsAppearanceElements, d as ReturnsAppearanceTokens, e as ReturnsSlotAppearance, f as ReturnsSlotName, h as ReturnsTextKey, a as ReturnsTexts, g as ReturnsTheme } from './texts-CIEFbJTN.js';
6
7
  import { ReactNode } from 'react';
7
8
  import z__default from 'zod';
8
- import { P as PanelProps, G as GetThemeOutput } from './types-BTm_ZolC.js';
9
- export { a as PanelLoginProps, b as PanelScreen, c as PanelSearchParamsType } from './types-BTm_ZolC.js';
9
+ import { P as PanelProps, G as GetThemeOutput } from './types-BaqLJYuq.js';
10
+ export { a as PanelLoginProps, b as PanelScreen, c as PanelSearchParamsType } from './types-BaqLJYuq.js';
10
11
  import './models.js';
11
12
  import '@bufbuild/protobuf/wkt';
12
13
  import '@bufbuild/protobuf';
@@ -34,6 +35,12 @@ type Props$3 = {
34
35
  };
35
36
  }[];
36
37
  onClick?: () => Promise<void>;
38
+ /**
39
+ * Usage statistics for your Bitsnap dashboard (Apple Pay clicks and
40
+ * results). On by default; `false` turns it off. Inside `<BitsnapCheckout>`
41
+ * the checkout's setting applies unless this is given.
42
+ */
43
+ analytics?: AnalyticsOption;
37
44
  };
38
45
  declare function Wrapper$2(props: Props$3): react_jsx_runtime.JSX.Element;
39
46
 
@@ -146,8 +153,15 @@ type BitsnapCartProps = {
146
153
  * whatever the locale; omitted keys keep the `pl`/`en` defaults.
147
154
  */
148
155
  texts?: Partial<CheckoutTexts>;
156
+ /**
157
+ * Usage statistics for your Bitsnap dashboard (cart opened, checkout
158
+ * started, add to cart). On by default; `false` turns it off. An object
159
+ * lets you forward every event: `{ onEvent }`. Nothing is stored on the
160
+ * visitor's device.
161
+ */
162
+ analytics?: AnalyticsOption;
149
163
  };
150
- declare function BitsnapCart({ projectID, locale, children, onVisibleChange, className, numberOfProductsInCartOptions, appearance, texts, }: BitsnapCartProps): react_jsx_runtime.JSX.Element;
164
+ declare function BitsnapCart({ projectID, locale, children, onVisibleChange, className, numberOfProductsInCartOptions, appearance, texts, analytics, }: BitsnapCartProps): react_jsx_runtime.JSX.Element;
151
165
 
152
166
  type Props$2 = {
153
167
  test?: boolean;
@@ -166,6 +180,12 @@ type Props$2 = {
166
180
  [key: string]: string | undefined;
167
181
  };
168
182
  }[];
183
+ /**
184
+ * Usage statistics for your Bitsnap dashboard. On by default; `false` turns
185
+ * it off. Inside `<BitsnapCheckout>` the checkout's setting applies unless
186
+ * this is given.
187
+ */
188
+ analytics?: AnalyticsOption;
169
189
  };
170
190
  declare function Wrapper$1(props: Props$2): react_jsx_runtime.JSX.Element;
171
191
 
@@ -299,10 +319,21 @@ interface NotificationsComponentPublicProps {
299
319
  * Custom CSS class names for various component sections (for easier styling).
300
320
  */
301
321
  className?: ComponentClassNames;
322
+ /**
323
+ * Public project ID used for usage statistics. Defaults to the one set by
324
+ * `<BitsnapCheckout projectID>`.
325
+ */
326
+ projectID?: string;
327
+ /**
328
+ * Usage statistics for your Bitsnap dashboard (sign-ups). On by default;
329
+ * `false` turns it off. An object lets you forward every event:
330
+ * `{ onEvent }`. Nothing is stored on the visitor's device.
331
+ */
332
+ analytics?: AnalyticsOption;
302
333
  }
303
334
 
304
335
  type Props$1 = NotificationsComponentPublicProps;
305
- declare function Wrapper({ slug, userID, productID, projectName, projectLogo, projectLogoDark, groups, isManaging, texts, showQRCode, showPhoneInput, hiddenGroupIds, className, }: Props$1): react_jsx_runtime.JSX.Element;
336
+ declare function Wrapper({ slug, userID, productID, projectID, analytics, projectName, projectLogo, projectLogoDark, groups, isManaging, texts, showQRCode, showPhoneInput, hiddenGroupIds, className, }: Props$1): react_jsx_runtime.JSX.Element;
306
337
 
307
338
  type ErrTypes = "internal" | "badInput" | "notFound";
308
339
  type Err = {
@@ -414,6 +445,8 @@ declare namespace Bitsnap {
414
445
  name?: string;
415
446
  price?: number;
416
447
  currency?: string;
448
+ /** Where `add_to_cart` is reported. Defaults to the mounted `<BitsnapCheckout>`. */
449
+ analytics?: Instrument;
417
450
  }): Promise<Err | undefined>;
418
451
  function showCart(): void;
419
452
  function hideCart(): void;
@@ -431,15 +464,22 @@ declare function createCheckout(request: LinkRequest & {
431
464
  declare function getReferenceIfPossible(): string | undefined;
432
465
  declare function injectReferenceToRequestIfNeeded(request: LinkRequest): LinkRequest;
433
466
 
434
- declare const PanelLogin: () => react_jsx_runtime.JSX.Element;
467
+ declare const PanelLogin: ({ analytics, }?: {
468
+ analytics?: AnalyticsOption;
469
+ }) => react_jsx_runtime.JSX.Element;
435
470
 
436
- declare const PanelPage: ({ returnsAppearance, returnsTexts, }?: Pick<PanelProps, "returnsAppearance" | "returnsTexts">) => react_jsx_runtime.JSX.Element;
471
+ declare const PanelPage: ({ returnsAppearance, returnsTexts, analytics, }?: Pick<PanelProps, "returnsAppearance" | "returnsTexts" | "analytics">) => react_jsx_runtime.JSX.Element;
437
472
 
438
473
  interface Props {
439
474
  orderID: string;
440
475
  initialEmail?: string;
441
476
  accessToken?: string;
442
477
  onBack?: () => void;
478
+ /**
479
+ * Usage statistics for your Bitsnap dashboard (order viewed). Inside
480
+ * `<Panel>` or `<PanelProvider>` their setting applies unless this is given.
481
+ */
482
+ analytics?: AnalyticsOption;
443
483
  }
444
484
  declare function PublicOrderPage(props: Props): react_jsx_runtime.JSX.Element;
445
485
 
@@ -461,6 +501,13 @@ declare function getAllowedReturnOrigins(): string[];
461
501
 
462
502
  declare const PanelProvider: React.FC<{
463
503
  children: React.ReactNode;
504
+ /**
505
+ * Usage statistics for your Bitsnap dashboard (panel logins, orders viewed,
506
+ * downloads, course progress). On by default; `false` turns it off. An
507
+ * object lets you forward every event: `{ onEvent }`. Nothing is stored on
508
+ * the visitor's device.
509
+ */
510
+ analytics?: AnalyticsOption;
464
511
  }>;
465
512
  declare const usePanelConfig: () => PanelConfig;
466
513
 
@@ -469,4 +516,4 @@ declare function persistReturnURL(returnURL: string | null): void;
469
516
  declare function readPersistedReturnURL(): string | null;
470
517
  declare function buildAccessTokenRedirect(returnURL: string, accessToken: string): string;
471
518
 
472
- export { Wrapper$2 as ApplePayButton, type Props$3 as ApplePayButtonProps, Bitsnap, type BitsnapCartProps, BitsnapCart as BitsnapCheckout, CHECKOUT_SLOT_NAMES, type CheckoutAppearance, type CheckoutAppearanceElements, type CheckoutAppearanceTokens, type CheckoutSlotAppearance, type CheckoutSlotName, type CheckoutTexts, type CheckoutTheme, type ComponentClassNames, type CustomizationTexts, GetThemeOutput, Wrapper$1 as GooglePayButton, type Props$2 as GooglePayButtonProps, type LinkRequest, type NotificationGroup, Wrapper as NotificationsComponent, type Props$1 as NotificationsComponentProps, type NotificationsComponentPublicProps, PanelPage as Panel, type PanelConfig, PanelLogin, PanelProps, PanelProvider, type PublicNotificationGroup, PublicOrderPage, buildAccessTokenRedirect, createCheckout, createPaymentURL, getAllowedReturnOrigins, getLocale, getPanelConfig, getReferenceIfPossible, getReturnURLFromSearch, injectReferenceToRequestIfNeeded, persistReturnURL, readPersistedReturnURL, setAllowedReturnOrigins, setCustomHost, setHost, setLocale, setLoginURL, setPanelConfig, setProjectID as setPanelProjectID, setProjectID$1 as setProjectID, setTheme, usePanelConfig };
519
+ export { AnalyticsOption, Wrapper$2 as ApplePayButton, type Props$3 as ApplePayButtonProps, Bitsnap, type BitsnapCartProps, BitsnapCart as BitsnapCheckout, CHECKOUT_SLOT_NAMES, type CheckoutAppearance, type CheckoutAppearanceElements, type CheckoutAppearanceTokens, type CheckoutSlotAppearance, type CheckoutSlotName, type CheckoutTexts, type CheckoutTheme, type ComponentClassNames, type CustomizationTexts, GetThemeOutput, Wrapper$1 as GooglePayButton, type Props$2 as GooglePayButtonProps, type LinkRequest, type NotificationGroup, Wrapper as NotificationsComponent, type Props$1 as NotificationsComponentProps, type NotificationsComponentPublicProps, PanelPage as Panel, type PanelConfig, PanelLogin, PanelProps, PanelProvider, type PublicNotificationGroup, PublicOrderPage, buildAccessTokenRedirect, createCheckout, createPaymentURL, getAllowedReturnOrigins, getLocale, getPanelConfig, getReferenceIfPossible, getReturnURLFromSearch, injectReferenceToRequestIfNeeded, persistReturnURL, readPersistedReturnURL, setAllowedReturnOrigins, setCustomHost, setHost, setLocale, setLoginURL, setPanelConfig, setProjectID as setPanelProjectID, setProjectID$1 as setProjectID, setTheme, usePanelConfig };