@beworke/pixel 0.1.0-rc.6 → 0.1.0-rc.8

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 (166) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +71 -56
  3. package/RELEASE_CANDIDATE.md +47 -75
  4. package/dist/Pixel-CCgGk43j.d.ts +797 -0
  5. package/dist/Pixel-CqbgC_72.d.mts +797 -0
  6. package/dist/{StorageFactory-tjfzk57c.d.ts → StorageFactory-BRBsnnH7.d.ts} +2 -2
  7. package/dist/{StorageFactory-CPghDPBj.d.mts → StorageFactory-Dp19Wecr.d.mts} +2 -2
  8. package/dist/browser/index.cjs.js +3 -0
  9. package/dist/browser/index.cjs.js.map +1 -0
  10. package/dist/browser/index.d.mts +55 -0
  11. package/dist/browser/index.d.ts +55 -0
  12. package/dist/browser/index.esm.js +3 -0
  13. package/dist/browser/index.esm.js.map +1 -0
  14. package/dist/browser/pixel.global.js +4 -0
  15. package/dist/browser/pixel.global.js.map +1 -0
  16. package/dist/config/index.cjs.js +1 -1
  17. package/dist/config/index.cjs.js.map +1 -1
  18. package/dist/config/index.d.mts +16 -6
  19. package/dist/config/index.d.ts +16 -6
  20. package/dist/config/index.esm.js +1 -1
  21. package/dist/config/index.esm.js.map +1 -1
  22. package/dist/events/index.cjs.js.map +1 -1
  23. package/dist/events/index.d.mts +2 -2
  24. package/dist/events/index.d.ts +2 -2
  25. package/dist/events/index.esm.js.map +1 -1
  26. package/dist/examples/html-script/README.md +20 -76
  27. package/dist/examples/html-script/RELEASE_CANDIDATE.md +20 -21
  28. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-autocomplete.html +41 -48
  29. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-disabled.html +41 -48
  30. package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-fields.html +41 -48
  31. package/dist/examples/html-script/add-payment-info/example-add-payment-info-data-track.html +41 -48
  32. package/dist/examples/html-script/add-payment-info/example-add-payment-info-dedupe.html +41 -48
  33. package/dist/examples/html-script/add-payment-info/example-add-payment-info-manual.html +41 -48
  34. package/dist/examples/html-script/add-payment-info/example-add-payment-info-rules-card.html +41 -48
  35. package/dist/examples/html-script/add-payment-info/example-add-payment-info-security.html +41 -48
  36. package/dist/examples/html-script/add-to-cart/README.md +6 -3
  37. package/dist/examples/html-script/add-to-cart/example-add-to-cart-attribute.html +43 -49
  38. package/dist/examples/html-script/add-to-cart/example-add-to-cart-auto.html +43 -49
  39. package/dist/examples/html-script/add-to-cart/example-add-to-cart-click.html +43 -49
  40. package/dist/examples/html-script/add-to-cart/example-add-to-cart-dedupe.html +43 -49
  41. package/dist/examples/html-script/add-to-cart/example-add-to-cart-link.html +590 -0
  42. package/dist/examples/html-script/add-to-cart/example-add-to-cart-manual.html +43 -49
  43. package/dist/examples/html-script/add-to-cart/example-add-to-cart-order-bump.html +43 -49
  44. package/dist/examples/html-script/add-to-cart/example-add-to-cart-text.html +43 -49
  45. package/dist/examples/html-script/behavior/example-behavior-engagement.html +5 -5
  46. package/dist/examples/html-script/behavior/example-behavior-heartbeat.html +5 -5
  47. package/dist/examples/html-script/behavior/example-behavior-runtime-intelligence.html +5 -5
  48. package/dist/examples/html-script/behavior/example-behavior-viewport.html +5 -5
  49. package/dist/examples/html-script/behavior/example-behavior.html +1 -1
  50. package/dist/examples/html-script/buygoods/example-buygoods-checkout.html +83 -0
  51. package/dist/examples/html-script/example-basic.html +1 -1
  52. package/dist/examples/html-script/example-checkout-commerce.html +32 -31
  53. package/dist/examples/html-script/example-conversion.html +42 -49
  54. package/dist/examples/html-script/example-global-factory-classic.html +45 -0
  55. package/dist/examples/html-script/example-global-factory.html +40 -0
  56. package/dist/examples/html-script/example-integration.html +40 -46
  57. package/dist/examples/html-script/example-landing-commerce.html +45 -9
  58. package/dist/examples/html-script/example-runtime-diagnostics.html +5 -5
  59. package/dist/examples/html-script/example-transport.html +65 -58
  60. package/dist/examples/html-script/full-funnel/README.md +1 -1
  61. package/dist/examples/html-script/full-funnel/checkout.html +4 -2
  62. package/dist/examples/html-script/full-funnel/downsell.html +4 -2
  63. package/dist/examples/html-script/full-funnel/landing.html +57 -3
  64. package/dist/examples/html-script/full-funnel/thank-you.html +4 -2
  65. package/dist/examples/html-script/full-funnel/upsell.html +4 -2
  66. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-attribute.html +41 -48
  67. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-auto.html +41 -48
  68. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-click.html +41 -48
  69. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-manual.html +41 -48
  70. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-snapshot.html +41 -48
  71. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-submit.html +41 -48
  72. package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-text.html +41 -48
  73. package/dist/examples/html-script/lead/example-lead-trigger-attribute.html +41 -48
  74. package/dist/examples/html-script/lead/example-lead-trigger-auto.html +41 -48
  75. package/dist/examples/html-script/lead/example-lead-trigger-click.html +41 -48
  76. package/dist/examples/html-script/release-candidate.html +32 -31
  77. package/dist/examples/html-script/remove-from-cart/README.md +3 -3
  78. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-attribute.html +41 -48
  79. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-css.html +41 -48
  80. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-dedupe.html +48 -55
  81. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-manual.html +41 -48
  82. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-multi.html +41 -48
  83. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-state.html +41 -48
  84. package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-text.html +41 -48
  85. package/dist/examples/html-script/search/example-search-attribute.html +41 -48
  86. package/dist/examples/html-script/search/example-search-button-sync.html +41 -48
  87. package/dist/examples/html-script/search/example-search-dedupe.html +41 -48
  88. package/dist/examples/html-script/search/example-search-input.html +41 -48
  89. package/dist/examples/html-script/search/example-search-manual.html +41 -48
  90. package/dist/examples/html-script/search/example-search-submit.html +41 -48
  91. package/dist/examples/html-script/search/example-search-text.html +41 -48
  92. package/dist/examples/html-script/url-context/example-url-context-allowed-domains.html +38 -9
  93. package/dist/examples/html-script/url-context/example-url-context-landing.html +53 -13
  94. package/dist/examples/html-script/url-context/example-url-context-upsell.html +48 -10
  95. package/dist/examples/html-script/url-context/example-url-context.html +55 -21
  96. package/dist/examples/html-script/view-content/example-view-content-attribute.html +41 -48
  97. package/dist/examples/html-script/view-content/example-view-content-css.html +41 -48
  98. package/dist/examples/html-script/view-content/example-view-content-dedupe.html +41 -48
  99. package/dist/examples/html-script/view-content/example-view-content-empty.html +41 -48
  100. package/dist/examples/html-script/view-content/example-view-content-manual.html +41 -48
  101. package/dist/examples/html-script/view-content/example-view-content-product-card.html +41 -48
  102. package/dist/examples/html-script/view-content/example-view-content-text.html +41 -48
  103. package/dist/examples/release-candidate/README.md +2 -1
  104. package/dist/examples/v2/README.md +15 -15
  105. package/dist/{index-CQAyT5Od.d.ts → index-B8u_3PGG.d.ts} +21 -2
  106. package/dist/{index-JlKPz4pp.d.mts → index-BxT2d-TK.d.mts} +21 -2
  107. package/dist/index.cjs.js +1 -1
  108. package/dist/index.cjs.js.map +1 -1
  109. package/dist/index.d.mts +21 -782
  110. package/dist/index.d.ts +21 -782
  111. package/dist/index.esm.js +1 -1
  112. package/dist/index.esm.js.map +1 -1
  113. package/dist/{pixel-CKc4OQUx.d.mts → pixel-C93c-0M2.d.mts} +234 -101
  114. package/dist/{pixel-BxZZx8l5.d.ts → pixel-DVy4rzj8.d.ts} +234 -101
  115. package/dist/pixel-default-config-BkAjriVH.d.mts +21 -0
  116. package/dist/pixel-default-config-Co69vDP3.d.ts +21 -0
  117. package/dist/pixel-settings-BhfJqA92.d.mts +40 -0
  118. package/dist/pixel-settings-C0qPFTii.d.ts +40 -0
  119. package/dist/runtime/index.cjs.js +1 -1
  120. package/dist/runtime/index.cjs.js.map +1 -1
  121. package/dist/runtime/index.d.mts +6 -6
  122. package/dist/runtime/index.d.ts +6 -6
  123. package/dist/runtime/index.esm.js +1 -1
  124. package/dist/runtime/index.esm.js.map +1 -1
  125. package/dist/services/index.cjs.js +1 -1
  126. package/dist/services/index.cjs.js.map +1 -1
  127. package/dist/services/index.d.mts +7 -7
  128. package/dist/services/index.d.ts +7 -7
  129. package/dist/services/index.esm.js +1 -1
  130. package/dist/services/index.esm.js.map +1 -1
  131. package/dist/{types-C75pQP31.d.ts → types-B2aUNHb3.d.ts} +2 -2
  132. package/dist/{types-BP8dz1gP.d.mts → types-C0J9KUQg.d.mts} +2 -2
  133. package/dist/{types-DMhzHSVC.d.mts → types-C2dsBog1.d.mts} +2 -2
  134. package/dist/{types-D_SsCur9.d.ts → types-DcaBYgVI.d.ts} +2 -2
  135. package/dist/{url-context-BjAsQoVl.d.mts → url-context-Ck2LK18V.d.mts} +4 -2
  136. package/dist/{url-context-BjAsQoVl.d.ts → url-context-Ck2LK18V.d.ts} +4 -2
  137. package/dist/v2/global.global.js +1 -1
  138. package/dist/v2/global.global.js.map +1 -1
  139. package/dist/v2/index.cjs.js +1 -1
  140. package/dist/v2/index.cjs.js.map +1 -1
  141. package/dist/v2/index.d.mts +26 -8
  142. package/dist/v2/index.d.ts +26 -8
  143. package/dist/v2/index.esm.js +1 -1
  144. package/dist/v2/index.esm.js.map +1 -1
  145. package/docs/public/README.md +20 -15
  146. package/docs/public/api/exports.md +12 -8
  147. package/docs/public/api/pixel.md +28 -7
  148. package/docs/public/configuration/commerce.md +3 -3
  149. package/docs/public/configuration/modules.md +11 -14
  150. package/docs/public/configuration/overview.md +41 -25
  151. package/docs/public/configuration/transport.md +127 -0
  152. package/docs/public/events/catalog.md +3 -1
  153. package/docs/public/getting-started/installation.md +20 -15
  154. package/docs/public/getting-started/quick-start.md +95 -30
  155. package/docs/public/getting-started/react-nextjs.md +57 -34
  156. package/docs/public/getting-started/script-tag.md +55 -32
  157. package/docs/public/guides/funnel-checkout.md +2 -2
  158. package/docs/public/guides/funnel-full.md +3 -3
  159. package/docs/public/guides/funnel-landing.md +10 -8
  160. package/docs/public/limitations.md +6 -5
  161. package/docs/public/privacy/limitations.md +6 -6
  162. package/docs/public/release-candidate/validation.md +24 -19
  163. package/docs/public/troubleshooting.md +7 -6
  164. package/package.json +15 -14
  165. package/dist/pixel-default-config-CJl-eypl.d.mts +0 -5
  166. package/dist/pixel-default-config-aAOujzwp.d.ts +0 -5
@@ -149,7 +149,7 @@ code { font-size: 0.85em; }
149
149
  </div>
150
150
  </div>
151
151
 
152
- <script src="../../../dist/v2/global.global.js"></script>
152
+ <script src="../../../v2/global.global.js"></script>
153
153
  <script>
154
154
  const { Pixel, DEFAULT_PIXEL_CONFIG } = window.PixelV2;
155
155
  const API_ENDPOINT =
@@ -206,9 +206,46 @@ code { font-size: 0.85em; }
206
206
  debug: true,
207
207
  },
208
208
  transport: {
209
- ...DEFAULT_PIXEL_CONFIG.transport,
210
- apiEndpoint: API_ENDPOINT,
211
- timeoutMs: 10000,
209
+ ...base.transport,
210
+ enabled: true,
211
+ sender: { mode: 'internal', baseUrl: API_ENDPOINT },
212
+ persistence: { enabled: true },
213
+ replay: { enabled: true },
214
+ ordering: { enabled: true },
215
+ coordination: { enabled: true },
216
+ circuitBreaker: {
217
+ enabled: true,
218
+ failureThreshold: 5,
219
+ resetTimeoutMs: 30000,
220
+ halfOpenMaxAttempts: 2,
221
+ },
222
+ backpressure: {
223
+ enabled: true,
224
+ maxQueueSize: 500,
225
+ policy: 'drop_oldest',
226
+ sampleRate: 0.5,
227
+ },
228
+ deadLetter: { enabled: true, maxEntries: 200 },
229
+ compression: { enabled: true, strategy: 'identity' },
230
+ retry: {
231
+ enabled: true,
232
+ maxAttempts: 4,
233
+ baseDelayMs: 500,
234
+ maxDelayMs: 4000,
235
+ multiplier: 2,
236
+ },
237
+ batch: {
238
+ enabled: true,
239
+ batchSize: 10,
240
+ maxWaitMs: 5000,
241
+ },
242
+ timeout: { enabled: true, timeoutMs: 10000 },
243
+ offline: { enabled: true },
244
+ flush: {
245
+ enabled: true,
246
+ flushOnDestroy: true,
247
+ prepareUnloadHooks: true,
248
+ },
212
249
  },
213
250
  identity: { ...base.identity, pixelId: PIXEL_ID },
214
251
  commerce: {
@@ -264,50 +301,6 @@ code { font-size: 0.85em; }
264
301
  },
265
302
  behavior: { ...base.modules.behavior, enabled: false },
266
303
  privacy: { ...base.modules.privacy, enabled: false },
267
- transport: {
268
- enabled: true,
269
- mockSender: { enabled: false },
270
- sender: { mode: 'http' },
271
- persistence: { enabled: true },
272
- replay: { enabled: true },
273
- ordering: { enabled: true },
274
- coordination: { enabled: true },
275
- circuitBreaker: {
276
- enabled: true,
277
- failureThreshold: 5,
278
- resetTimeoutMs: 30000,
279
- halfOpenMaxAttempts: 2,
280
- },
281
- backpressure: {
282
- enabled: true,
283
- maxQueueSize: 500,
284
- policy: 'drop_oldest',
285
- sampleRate: 0.5,
286
- },
287
- deadLetter: { enabled: true, maxEntries: 200 },
288
- compression: { enabled: true, strategy: 'identity' },
289
- retry: {
290
- enabled: true,
291
- maxAttempts: 4,
292
- baseDelayMs: 500,
293
- maxDelayMs: 4000,
294
- multiplier: 2,
295
- },
296
- batch: {
297
- enabled: true,
298
- batchSize: 10,
299
- flushIntervalMs: 2000,
300
- maxWaitMs: 5000,
301
- },
302
- timeout: { enabled: true, timeoutMs: 10000 },
303
- offline: { enabled: true },
304
- flush: {
305
- enabled: true,
306
- flushIntervalMs: 2000,
307
- flushOnDestroy: true,
308
- prepareUnloadHooks: true,
309
- },
310
- },
311
304
  integrations: { ...base.modules.integrations, enabled: false },
312
305
  conversion: {
313
306
  enabled: true,
@@ -5,9 +5,24 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Pixel v2 — UrlContext allowedDomains</title>
7
7
  <style>
8
- body { font-family: system-ui, sans-serif; max-width: 720px; margin: 2rem auto; padding: 0 1rem; }
9
- a { display: block; margin: 0.5rem 0; }
10
- pre { background: #0f172a; color: #e2e8f0; padding: 0.75rem; border-radius: 8px; font-size: 0.75rem; overflow: auto; }
8
+ body {
9
+ font-family: system-ui, sans-serif;
10
+ max-width: 720px;
11
+ margin: 2rem auto;
12
+ padding: 0 1rem;
13
+ }
14
+ a {
15
+ display: block;
16
+ margin: 0.5rem 0;
17
+ }
18
+ pre {
19
+ background: #0f172a;
20
+ color: #e2e8f0;
21
+ padding: 0.75rem;
22
+ border-radius: 8px;
23
+ font-size: 0.75rem;
24
+ overflow: auto;
25
+ }
11
26
  </style>
12
27
  </head>
13
28
  <body>
@@ -15,19 +30,28 @@
15
30
  <p>Esperado: apenas o link de checkout recebe <code>sid</code>.</p>
16
31
 
17
32
  <a id="checkout" href="https://checkout.bemony.com/pay">Checkout Bemony</a>
18
- <a id="security" href="https://security.bemony.com/upsell/accept">Security Bemony</a>
33
+ <a id="security" href="https://security.bemony.com/upsell/accept"
34
+ >Security Bemony</a
35
+ >
19
36
  <a id="mine" href="https://meusite.com/pagina">Meu site</a>
20
37
 
21
38
  <pre id="out">init…</pre>
22
39
 
23
- <script src="../../dist/v2/global.global.js"></script>
40
+ <script src="../../../v2/global.global.js"></script>
24
41
  <script>
25
42
  (async function () {
26
43
  var { Pixel, DEFAULT_PIXEL_CONFIG } = window.PixelV2;
27
44
  var pixel = new Pixel({
28
45
  ...DEFAULT_PIXEL_CONFIG,
29
46
  app: { ...DEFAULT_PIXEL_CONFIG.app, debug: true },
30
- identity: { ...DEFAULT_PIXEL_CONFIG.identity, pixelId: 'pix_uc_domains' },
47
+ identity: {
48
+ ...DEFAULT_PIXEL_CONFIG.identity,
49
+ pixelId: 'pix_uc_domains',
50
+ },
51
+ transport: {
52
+ ...DEFAULT_PIXEL_CONFIG.transport,
53
+ enabled: false,
54
+ },
31
55
  modules: {
32
56
  ...DEFAULT_PIXEL_CONFIG.modules,
33
57
  core: {
@@ -41,9 +65,14 @@
41
65
  },
42
66
  },
43
67
  },
44
- transport: { ...DEFAULT_PIXEL_CONFIG.modules.transport, enabled: false },
45
- integrations: { ...DEFAULT_PIXEL_CONFIG.modules.integrations, enabled: false },
46
- conversion: { ...DEFAULT_PIXEL_CONFIG.modules.conversion, enabled: false },
68
+ integrations: {
69
+ ...DEFAULT_PIXEL_CONFIG.modules.integrations,
70
+ enabled: false,
71
+ },
72
+ conversion: {
73
+ ...DEFAULT_PIXEL_CONFIG.modules.conversion,
74
+ enabled: false,
75
+ },
47
76
  },
48
77
  });
49
78
  await pixel.init();
@@ -5,10 +5,28 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Pixel v2 — UrlContext Landing</title>
7
7
  <style>
8
- body { font-family: system-ui, sans-serif; max-width: 720px; margin: 2rem auto; padding: 0 1rem; }
9
- a { display: block; margin: 0.5rem 0; }
10
- pre { background: #0f172a; color: #e2e8f0; padding: 0.75rem; border-radius: 8px; font-size: 0.75rem; overflow: auto; }
11
- .hint { color: #64748b; font-size: 0.9rem; }
8
+ body {
9
+ font-family: system-ui, sans-serif;
10
+ max-width: 720px;
11
+ margin: 2rem auto;
12
+ padding: 0 1rem;
13
+ }
14
+ a {
15
+ display: block;
16
+ margin: 0.5rem 0;
17
+ }
18
+ pre {
19
+ background: #0f172a;
20
+ color: #e2e8f0;
21
+ padding: 0.75rem;
22
+ border-radius: 8px;
23
+ font-size: 0.75rem;
24
+ overflow: auto;
25
+ }
26
+ .hint {
27
+ color: #64748b;
28
+ font-size: 0.9rem;
29
+ }
12
30
  </style>
13
31
  </head>
14
32
  <body>
@@ -17,25 +35,38 @@
17
35
  Abra com query, ex.:
18
36
  <code>?utm_source=facebook&amp;affid=aff_123&amp;src=redtrack_abc</code>
19
37
  <br />
20
- Debug: console mostra snapshot; href do checkout deve ganhar <code>sid</code> + UTMs sem duplicar params.
38
+ Debug: console mostra snapshot; href do checkout deve ganhar
39
+ <code>sid</code> + UTMs sem duplicar params.
40
+ </p>
41
+ <p>
42
+ Esperado: gera <code>sid</code>, preserva UTMs/affid/src, decora checkout
43
+ (abs + relativo).
21
44
  </p>
22
- <p>Esperado: gera <code>sid</code>, preserva UTMs/affid/src, decora checkout (abs + relativo).</p>
23
45
 
24
46
  <a id="c1" href="https://checkout.bemony.com/pay">Checkout absoluto</a>
25
- <a id="c2" href="https://checkout.bemony.com/pay?product=main">Checkout + product</a>
47
+ <a id="c2" href="https://checkout.bemony.com/pay?product=main"
48
+ >Checkout + product</a
49
+ >
26
50
  <a id="c3" href="/checkout#step">Checkout relativo + hash</a>
27
51
  <a href="https://facebook.com/x">Externo (não decorar)</a>
28
52
 
29
53
  <pre id="out">init…</pre>
30
54
 
31
- <script src="../../dist/v2/global.global.js"></script>
55
+ <script src="../../../v2/global.global.js"></script>
32
56
  <script>
33
57
  (async function () {
34
58
  var { Pixel, DEFAULT_PIXEL_CONFIG } = window.PixelV2;
35
59
  var pixel = new Pixel({
36
60
  ...DEFAULT_PIXEL_CONFIG,
37
61
  app: { ...DEFAULT_PIXEL_CONFIG.app, debug: true },
38
- identity: { ...DEFAULT_PIXEL_CONFIG.identity, pixelId: 'pix_uc_landing' },
62
+ identity: {
63
+ ...DEFAULT_PIXEL_CONFIG.identity,
64
+ pixelId: 'pix_uc_landing',
65
+ },
66
+ transport: {
67
+ ...DEFAULT_PIXEL_CONFIG.transport,
68
+ enabled: false,
69
+ },
39
70
  modules: {
40
71
  ...DEFAULT_PIXEL_CONFIG.modules,
41
72
  core: {
@@ -49,9 +80,14 @@
49
80
  },
50
81
  },
51
82
  },
52
- transport: { ...DEFAULT_PIXEL_CONFIG.modules.transport, enabled: false },
53
- integrations: { ...DEFAULT_PIXEL_CONFIG.modules.integrations, enabled: false },
54
- conversion: { ...DEFAULT_PIXEL_CONFIG.modules.conversion, enabled: false },
83
+ integrations: {
84
+ ...DEFAULT_PIXEL_CONFIG.modules.integrations,
85
+ enabled: false,
86
+ },
87
+ conversion: {
88
+ ...DEFAULT_PIXEL_CONFIG.modules.conversion,
89
+ enabled: false,
90
+ },
55
91
  },
56
92
  });
57
93
  await pixel.init();
@@ -62,7 +98,11 @@
62
98
  checkout2: document.getElementById('c2').getAttribute('href'),
63
99
  checkoutRelative: document.getElementById('c3').getAttribute('href'),
64
100
  };
65
- document.getElementById('out').textContent = JSON.stringify(debug, null, 2);
101
+ document.getElementById('out').textContent = JSON.stringify(
102
+ debug,
103
+ null,
104
+ 2
105
+ );
66
106
  console.debug('[UrlContext landing]', debug);
67
107
  })();
68
108
  </script>
@@ -5,10 +5,33 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Pixel v2 — UrlContext Upsell</title>
7
7
  <style>
8
- body { font-family: system-ui, sans-serif; max-width: 720px; margin: 2rem auto; padding: 0 1rem; }
9
- a { display: inline-block; margin: 0.5rem 0.5rem 0 0; padding: 0.5rem 0.85rem; background: #0f766e; color: #fff; border-radius: 8px; text-decoration: none; }
10
- pre { background: #0f172a; color: #e2e8f0; padding: 0.75rem; border-radius: 8px; font-size: 0.75rem; overflow: auto; }
11
- .hint { color: #64748b; font-size: 0.9rem; }
8
+ body {
9
+ font-family: system-ui, sans-serif;
10
+ max-width: 720px;
11
+ margin: 2rem auto;
12
+ padding: 0 1rem;
13
+ }
14
+ a {
15
+ display: inline-block;
16
+ margin: 0.5rem 0.5rem 0 0;
17
+ padding: 0.5rem 0.85rem;
18
+ background: #0f766e;
19
+ color: #fff;
20
+ border-radius: 8px;
21
+ text-decoration: none;
22
+ }
23
+ pre {
24
+ background: #0f172a;
25
+ color: #e2e8f0;
26
+ padding: 0.75rem;
27
+ border-radius: 8px;
28
+ font-size: 0.75rem;
29
+ overflow: auto;
30
+ }
31
+ .hint {
32
+ color: #64748b;
33
+ font-size: 0.9rem;
34
+ }
12
35
  </style>
13
36
  </head>
14
37
  <body>
@@ -24,14 +47,21 @@
24
47
 
25
48
  <pre id="out">init…</pre>
26
49
 
27
- <script src="../../dist/v2/global.global.js"></script>
50
+ <script src="../../../v2/global.global.js"></script>
28
51
  <script>
29
52
  (async function () {
30
53
  var { Pixel, DEFAULT_PIXEL_CONFIG } = window.PixelV2;
31
54
  var pixel = new Pixel({
32
55
  ...DEFAULT_PIXEL_CONFIG,
33
56
  app: { ...DEFAULT_PIXEL_CONFIG.app, debug: true },
34
- identity: { ...DEFAULT_PIXEL_CONFIG.identity, pixelId: 'pix_uc_upsell' },
57
+ identity: {
58
+ ...DEFAULT_PIXEL_CONFIG.identity,
59
+ pixelId: 'pix_uc_upsell',
60
+ },
61
+ transport: {
62
+ ...DEFAULT_PIXEL_CONFIG.transport,
63
+ enabled: false,
64
+ },
35
65
  modules: {
36
66
  ...DEFAULT_PIXEL_CONFIG.modules,
37
67
  core: {
@@ -41,13 +71,21 @@
41
71
  linkDecoration: {
42
72
  enabled: true,
43
73
  strategy: 'both',
44
- allowedDomains: ['security.bemony.com', 'checkout.bemony.com'],
74
+ allowedDomains: [
75
+ 'security.bemony.com',
76
+ 'checkout.bemony.com',
77
+ ],
45
78
  },
46
79
  },
47
80
  },
48
- transport: { ...DEFAULT_PIXEL_CONFIG.modules.transport, enabled: false },
49
- integrations: { ...DEFAULT_PIXEL_CONFIG.modules.integrations, enabled: false },
50
- conversion: { ...DEFAULT_PIXEL_CONFIG.modules.conversion, enabled: false },
81
+ integrations: {
82
+ ...DEFAULT_PIXEL_CONFIG.modules.integrations,
83
+ enabled: false,
84
+ },
85
+ conversion: {
86
+ ...DEFAULT_PIXEL_CONFIG.modules.conversion,
87
+ enabled: false,
88
+ },
51
89
  },
52
90
  });
53
91
  await pixel.init();
@@ -20,7 +20,8 @@
20
20
  margin: 1rem 0;
21
21
  background: #fff;
22
22
  }
23
- a, button {
23
+ a,
24
+ button {
24
25
  display: inline-block;
25
26
  margin: 0.35rem 0.35rem 0.35rem 0;
26
27
  padding: 0.45rem 0.75rem;
@@ -32,7 +33,11 @@
32
33
  font: inherit;
33
34
  cursor: pointer;
34
35
  }
35
- button.primary { background: #0f766e; color: #fff; border-color: #0f766e; }
36
+ button.primary {
37
+ background: #0f766e;
38
+ color: #fff;
39
+ border-color: #0f766e;
40
+ }
36
41
  pre {
37
42
  background: #0f172a;
38
43
  color: #e2e8f0;
@@ -42,26 +47,52 @@
42
47
  overflow: auto;
43
48
  max-height: 280px;
44
49
  }
45
- .hint { color: #64748b; font-size: 0.9rem; }
46
- code { font-size: 0.85em; }
50
+ .hint {
51
+ color: #64748b;
52
+ font-size: 0.9rem;
53
+ }
54
+ code {
55
+ font-size: 0.85em;
56
+ }
47
57
  </style>
48
58
  </head>
49
59
  <body>
50
60
  <h1>UrlContext — Core (Etapa 15A)</h1>
51
61
  <p class="hint">
52
- <code>sid</code> público da URL <strong>não</strong> é o <code>session_id</code> interno do Pixel.
53
- <code>order_id</code> pode ir na URL; token de pagamento fica em cookie HttpOnly no backend.
54
- Decoration: relativa (<code>/checkout#payment</code>), absoluta e exclusões (mailto, download, social).
62
+ <code>sid</code> público da URL <strong>não</strong> é o
63
+ <code>session_id</code> interno do Pixel. <code>order_id</code> pode ir na
64
+ URL; token de pagamento fica em cookie HttpOnly no backend. Decoration:
65
+ relativa (<code>/checkout#payment</code>), absoluta e exclusões (mailto,
66
+ download, social).
55
67
  </p>
56
68
 
57
69
  <div class="card">
58
70
  <h2>Links</h2>
59
- <a id="checkout-link" href="https://checkout.bemony.com/pay">Ir para checkout</a>
60
- <a id="checkout-relative" href="/checkout#payment">Relativo + hash (vira ?sid=#payment)</a>
61
- <a id="upsell-accept-link" href="https://security.bemony.com/upsell/accept">Sim, quero o upsell</a>
62
- <a id="upsell-decline-link" href="https://security.bemony.com/upsell/decline">Não, obrigado</a>
63
- <a id="external-link" href="https://facebook.com/test">Link externo (ignorado)</a>
64
- <a id="ignored-link" href="https://checkout.bemony.com/pay" data-no-url-context>Ignorado por selector</a>
71
+ <a id="checkout-link" href="https://checkout.bemony.com/pay"
72
+ >Ir para checkout</a
73
+ >
74
+ <a id="checkout-relative" href="/checkout#payment"
75
+ >Relativo + hash (vira ?sid=#payment)</a
76
+ >
77
+ <a
78
+ id="upsell-accept-link"
79
+ href="https://security.bemony.com/upsell/accept"
80
+ >Sim, quero o upsell</a
81
+ >
82
+ <a
83
+ id="upsell-decline-link"
84
+ href="https://security.bemony.com/upsell/decline"
85
+ >Não, obrigado</a
86
+ >
87
+ <a id="external-link" href="https://facebook.com/test"
88
+ >Link externo (ignorado)</a
89
+ >
90
+ <a
91
+ id="ignored-link"
92
+ href="https://checkout.bemony.com/pay"
93
+ data-no-url-context
94
+ >Ignorado por selector</a
95
+ >
65
96
  <a id="download-link" href="/file.pdf" download>Download ignorado</a>
66
97
  <a id="mailto-link" href="mailto:test@example.com">Mailto ignorado</a>
67
98
  </div>
@@ -77,7 +108,7 @@
77
108
  <pre id="out">Aguardando init…</pre>
78
109
  </div>
79
110
 
80
- <script src="../../dist/v2/global.global.js"></script>
111
+ <script src="../../../v2/global.global.js"></script>
81
112
  <script>
82
113
  (function () {
83
114
  var out = document.getElementById('out');
@@ -117,6 +148,10 @@
117
148
  ...DEFAULT_PIXEL_CONFIG.identity,
118
149
  pixelId: 'pix_url_context_demo',
119
150
  },
151
+ transport: {
152
+ ...DEFAULT_PIXEL_CONFIG.transport,
153
+ enabled: false,
154
+ },
120
155
  modules: {
121
156
  ...DEFAULT_PIXEL_CONFIG.modules,
122
157
  core: {
@@ -137,10 +172,6 @@
137
172
  ...DEFAULT_PIXEL_CONFIG.modules.conversion,
138
173
  enabled: true,
139
174
  },
140
- transport: {
141
- ...DEFAULT_PIXEL_CONFIG.modules.transport,
142
- enabled: false,
143
- },
144
175
  integrations: {
145
176
  ...DEFAULT_PIXEL_CONFIG.modules.integrations,
146
177
  enabled: false,
@@ -161,9 +192,12 @@
161
192
  document.getElementById('btn-ic').onclick = function () {
162
193
  if (!pixel) return;
163
194
  pixel.initiateCheckout();
164
- log('INITIATE_CHECKOUT disparado — ver query_params/url_context no Transport/debug', {
165
- snapshot: pixel.getDebugServices().urlContext.getSnapshot(),
166
- });
195
+ log(
196
+ 'INITIATE_CHECKOUT disparado — ver query_params/url_context no Transport/debug',
197
+ {
198
+ snapshot: pixel.getDebugServices().urlContext.getSnapshot(),
199
+ }
200
+ );
167
201
  };
168
202
  })();
169
203
  </script>
@@ -177,7 +177,7 @@ code { font-size: 0.85em; }
177
177
  </div>
178
178
  </div>
179
179
 
180
- <script src="../../../dist/v2/global.global.js"></script>
180
+ <script src="../../../v2/global.global.js"></script>
181
181
  <script>
182
182
  const { Pixel, DEFAULT_PIXEL_CONFIG } = window.PixelV2;
183
183
  const API_ENDPOINT =
@@ -229,9 +229,46 @@ code { font-size: 0.85em; }
229
229
  debug: true,
230
230
  },
231
231
  transport: {
232
- ...DEFAULT_PIXEL_CONFIG.transport,
233
- apiEndpoint: API_ENDPOINT,
234
- timeoutMs: 10000,
232
+ ...base.transport,
233
+ enabled: true,
234
+ sender: { mode: 'internal', baseUrl: API_ENDPOINT },
235
+ persistence: { enabled: true },
236
+ replay: { enabled: true },
237
+ ordering: { enabled: true },
238
+ coordination: { enabled: true },
239
+ circuitBreaker: {
240
+ enabled: true,
241
+ failureThreshold: 5,
242
+ resetTimeoutMs: 30000,
243
+ halfOpenMaxAttempts: 2,
244
+ },
245
+ backpressure: {
246
+ enabled: true,
247
+ maxQueueSize: 500,
248
+ policy: 'drop_oldest',
249
+ sampleRate: 0.5,
250
+ },
251
+ deadLetter: { enabled: true, maxEntries: 200 },
252
+ compression: { enabled: true, strategy: 'identity' },
253
+ retry: {
254
+ enabled: true,
255
+ maxAttempts: 4,
256
+ baseDelayMs: 500,
257
+ maxDelayMs: 4000,
258
+ multiplier: 2,
259
+ },
260
+ batch: {
261
+ enabled: true,
262
+ batchSize: 10,
263
+ maxWaitMs: 5000,
264
+ },
265
+ timeout: { enabled: true, timeoutMs: 10000 },
266
+ offline: { enabled: true },
267
+ flush: {
268
+ enabled: true,
269
+ flushOnDestroy: true,
270
+ prepareUnloadHooks: true,
271
+ },
235
272
  },
236
273
  identity: { ...base.identity, pixelId: PIXEL_ID },
237
274
  commerce: {
@@ -306,50 +343,6 @@ code { font-size: 0.85em; }
306
343
  },
307
344
  behavior: { ...base.modules.behavior, enabled: false },
308
345
  privacy: { ...base.modules.privacy, enabled: false },
309
- transport: {
310
- enabled: true,
311
- mockSender: { enabled: false },
312
- sender: { mode: 'http' },
313
- persistence: { enabled: true },
314
- replay: { enabled: true },
315
- ordering: { enabled: true },
316
- coordination: { enabled: true },
317
- circuitBreaker: {
318
- enabled: true,
319
- failureThreshold: 5,
320
- resetTimeoutMs: 30000,
321
- halfOpenMaxAttempts: 2,
322
- },
323
- backpressure: {
324
- enabled: true,
325
- maxQueueSize: 500,
326
- policy: 'drop_oldest',
327
- sampleRate: 0.5,
328
- },
329
- deadLetter: { enabled: true, maxEntries: 200 },
330
- compression: { enabled: true, strategy: 'identity' },
331
- retry: {
332
- enabled: true,
333
- maxAttempts: 4,
334
- baseDelayMs: 500,
335
- maxDelayMs: 4000,
336
- multiplier: 2,
337
- },
338
- batch: {
339
- enabled: true,
340
- batchSize: 10,
341
- flushIntervalMs: 2000,
342
- maxWaitMs: 5000,
343
- },
344
- timeout: { enabled: true, timeoutMs: 10000 },
345
- offline: { enabled: true },
346
- flush: {
347
- enabled: true,
348
- flushIntervalMs: 2000,
349
- flushOnDestroy: true,
350
- prepareUnloadHooks: true,
351
- },
352
- },
353
346
  integrations: { ...base.modules.integrations, enabled: false },
354
347
  conversion: {
355
348
  enabled: true,