@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.
- package/CHANGELOG.md +20 -0
- package/README.md +71 -56
- package/RELEASE_CANDIDATE.md +47 -75
- package/dist/Pixel-CCgGk43j.d.ts +797 -0
- package/dist/Pixel-CqbgC_72.d.mts +797 -0
- package/dist/{StorageFactory-tjfzk57c.d.ts → StorageFactory-BRBsnnH7.d.ts} +2 -2
- package/dist/{StorageFactory-CPghDPBj.d.mts → StorageFactory-Dp19Wecr.d.mts} +2 -2
- package/dist/browser/index.cjs.js +3 -0
- package/dist/browser/index.cjs.js.map +1 -0
- package/dist/browser/index.d.mts +55 -0
- package/dist/browser/index.d.ts +55 -0
- package/dist/browser/index.esm.js +3 -0
- package/dist/browser/index.esm.js.map +1 -0
- package/dist/browser/pixel.global.js +4 -0
- package/dist/browser/pixel.global.js.map +1 -0
- package/dist/config/index.cjs.js +1 -1
- package/dist/config/index.cjs.js.map +1 -1
- package/dist/config/index.d.mts +16 -6
- package/dist/config/index.d.ts +16 -6
- package/dist/config/index.esm.js +1 -1
- package/dist/config/index.esm.js.map +1 -1
- package/dist/events/index.cjs.js.map +1 -1
- package/dist/events/index.d.mts +2 -2
- package/dist/events/index.d.ts +2 -2
- package/dist/events/index.esm.js.map +1 -1
- package/dist/examples/html-script/README.md +20 -76
- package/dist/examples/html-script/RELEASE_CANDIDATE.md +20 -21
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-autocomplete.html +41 -48
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-disabled.html +41 -48
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-fields.html +41 -48
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-data-track.html +41 -48
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-dedupe.html +41 -48
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-manual.html +41 -48
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-rules-card.html +41 -48
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-security.html +41 -48
- package/dist/examples/html-script/add-to-cart/README.md +6 -3
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-attribute.html +43 -49
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-auto.html +43 -49
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-click.html +43 -49
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-dedupe.html +43 -49
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-link.html +590 -0
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-manual.html +43 -49
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-order-bump.html +43 -49
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-text.html +43 -49
- package/dist/examples/html-script/behavior/example-behavior-engagement.html +5 -5
- package/dist/examples/html-script/behavior/example-behavior-heartbeat.html +5 -5
- package/dist/examples/html-script/behavior/example-behavior-runtime-intelligence.html +5 -5
- package/dist/examples/html-script/behavior/example-behavior-viewport.html +5 -5
- package/dist/examples/html-script/behavior/example-behavior.html +1 -1
- package/dist/examples/html-script/buygoods/example-buygoods-checkout.html +83 -0
- package/dist/examples/html-script/example-basic.html +1 -1
- package/dist/examples/html-script/example-checkout-commerce.html +32 -31
- package/dist/examples/html-script/example-conversion.html +42 -49
- package/dist/examples/html-script/example-global-factory-classic.html +45 -0
- package/dist/examples/html-script/example-global-factory.html +40 -0
- package/dist/examples/html-script/example-integration.html +40 -46
- package/dist/examples/html-script/example-landing-commerce.html +45 -9
- package/dist/examples/html-script/example-runtime-diagnostics.html +5 -5
- package/dist/examples/html-script/example-transport.html +65 -58
- package/dist/examples/html-script/full-funnel/README.md +1 -1
- package/dist/examples/html-script/full-funnel/checkout.html +4 -2
- package/dist/examples/html-script/full-funnel/downsell.html +4 -2
- package/dist/examples/html-script/full-funnel/landing.html +57 -3
- package/dist/examples/html-script/full-funnel/thank-you.html +4 -2
- package/dist/examples/html-script/full-funnel/upsell.html +4 -2
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-attribute.html +41 -48
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-auto.html +41 -48
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-click.html +41 -48
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-manual.html +41 -48
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-snapshot.html +41 -48
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-submit.html +41 -48
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-text.html +41 -48
- package/dist/examples/html-script/lead/example-lead-trigger-attribute.html +41 -48
- package/dist/examples/html-script/lead/example-lead-trigger-auto.html +41 -48
- package/dist/examples/html-script/lead/example-lead-trigger-click.html +41 -48
- package/dist/examples/html-script/release-candidate.html +32 -31
- package/dist/examples/html-script/remove-from-cart/README.md +3 -3
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-attribute.html +41 -48
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-css.html +41 -48
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-dedupe.html +48 -55
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-manual.html +41 -48
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-multi.html +41 -48
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-state.html +41 -48
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-text.html +41 -48
- package/dist/examples/html-script/search/example-search-attribute.html +41 -48
- package/dist/examples/html-script/search/example-search-button-sync.html +41 -48
- package/dist/examples/html-script/search/example-search-dedupe.html +41 -48
- package/dist/examples/html-script/search/example-search-input.html +41 -48
- package/dist/examples/html-script/search/example-search-manual.html +41 -48
- package/dist/examples/html-script/search/example-search-submit.html +41 -48
- package/dist/examples/html-script/search/example-search-text.html +41 -48
- package/dist/examples/html-script/url-context/example-url-context-allowed-domains.html +38 -9
- package/dist/examples/html-script/url-context/example-url-context-landing.html +53 -13
- package/dist/examples/html-script/url-context/example-url-context-upsell.html +48 -10
- package/dist/examples/html-script/url-context/example-url-context.html +55 -21
- package/dist/examples/html-script/view-content/example-view-content-attribute.html +41 -48
- package/dist/examples/html-script/view-content/example-view-content-css.html +41 -48
- package/dist/examples/html-script/view-content/example-view-content-dedupe.html +41 -48
- package/dist/examples/html-script/view-content/example-view-content-empty.html +41 -48
- package/dist/examples/html-script/view-content/example-view-content-manual.html +41 -48
- package/dist/examples/html-script/view-content/example-view-content-product-card.html +41 -48
- package/dist/examples/html-script/view-content/example-view-content-text.html +41 -48
- package/dist/examples/release-candidate/README.md +2 -1
- package/dist/examples/v2/README.md +15 -15
- package/dist/{index-CQAyT5Od.d.ts → index-B8u_3PGG.d.ts} +21 -2
- package/dist/{index-JlKPz4pp.d.mts → index-BxT2d-TK.d.mts} +21 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +21 -782
- package/dist/index.d.ts +21 -782
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/{pixel-CKc4OQUx.d.mts → pixel-C93c-0M2.d.mts} +234 -101
- package/dist/{pixel-BxZZx8l5.d.ts → pixel-DVy4rzj8.d.ts} +234 -101
- package/dist/pixel-default-config-BkAjriVH.d.mts +21 -0
- package/dist/pixel-default-config-Co69vDP3.d.ts +21 -0
- package/dist/pixel-settings-BhfJqA92.d.mts +40 -0
- package/dist/pixel-settings-C0qPFTii.d.ts +40 -0
- package/dist/runtime/index.cjs.js +1 -1
- package/dist/runtime/index.cjs.js.map +1 -1
- package/dist/runtime/index.d.mts +6 -6
- package/dist/runtime/index.d.ts +6 -6
- package/dist/runtime/index.esm.js +1 -1
- package/dist/runtime/index.esm.js.map +1 -1
- package/dist/services/index.cjs.js +1 -1
- package/dist/services/index.cjs.js.map +1 -1
- package/dist/services/index.d.mts +7 -7
- package/dist/services/index.d.ts +7 -7
- package/dist/services/index.esm.js +1 -1
- package/dist/services/index.esm.js.map +1 -1
- package/dist/{types-C75pQP31.d.ts → types-B2aUNHb3.d.ts} +2 -2
- package/dist/{types-BP8dz1gP.d.mts → types-C0J9KUQg.d.mts} +2 -2
- package/dist/{types-DMhzHSVC.d.mts → types-C2dsBog1.d.mts} +2 -2
- package/dist/{types-D_SsCur9.d.ts → types-DcaBYgVI.d.ts} +2 -2
- package/dist/{url-context-BjAsQoVl.d.mts → url-context-Ck2LK18V.d.mts} +4 -2
- package/dist/{url-context-BjAsQoVl.d.ts → url-context-Ck2LK18V.d.ts} +4 -2
- package/dist/v2/global.global.js +1 -1
- package/dist/v2/global.global.js.map +1 -1
- package/dist/v2/index.cjs.js +1 -1
- package/dist/v2/index.cjs.js.map +1 -1
- package/dist/v2/index.d.mts +26 -8
- package/dist/v2/index.d.ts +26 -8
- package/dist/v2/index.esm.js +1 -1
- package/dist/v2/index.esm.js.map +1 -1
- package/docs/public/README.md +20 -15
- package/docs/public/api/exports.md +12 -8
- package/docs/public/api/pixel.md +28 -7
- package/docs/public/configuration/commerce.md +3 -3
- package/docs/public/configuration/modules.md +11 -14
- package/docs/public/configuration/overview.md +41 -25
- package/docs/public/configuration/transport.md +127 -0
- package/docs/public/events/catalog.md +3 -1
- package/docs/public/getting-started/installation.md +20 -15
- package/docs/public/getting-started/quick-start.md +95 -30
- package/docs/public/getting-started/react-nextjs.md +57 -34
- package/docs/public/getting-started/script-tag.md +55 -32
- package/docs/public/guides/funnel-checkout.md +2 -2
- package/docs/public/guides/funnel-full.md +3 -3
- package/docs/public/guides/funnel-landing.md +10 -8
- package/docs/public/limitations.md +6 -5
- package/docs/public/privacy/limitations.md +6 -6
- package/docs/public/release-candidate/validation.md +24 -19
- package/docs/public/troubleshooting.md +7 -6
- package/package.json +15 -14
- package/dist/pixel-default-config-CJl-eypl.d.mts +0 -5
- package/dist/pixel-default-config-aAOujzwp.d.ts +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @beworke/pixel
|
|
2
2
|
|
|
3
|
+
## 0.1.0-rc.8 — factory, browser bootstrap, global callable
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `createPixel()` no entry principal (instâncias independentes)
|
|
8
|
+
- Subpath `@beworke/pixel/browser` (`bootstrapPixel`, getters, destroy, `PixelBootstrapError`)
|
|
9
|
+
- Bundle `dist/browser/pixel.global.js` com `window.Pixel(settings)` callable
|
|
10
|
+
- Compatibilidade: `window.PixelV2` ganha `createPixel` / `bootstrap` / `getInstance` / `destroy`
|
|
11
|
+
- Pacote `@beworke/pixel-react` (`PixelProvider` / `usePixel`)
|
|
12
|
+
- `SDK_VERSION` centralizada e validada contra `package.json`
|
|
13
|
+
- `PixelSettings` (input público parcial) + `resolvePixelConfig()` no construtor de `Pixel`
|
|
14
|
+
- AutoTrack `selector` aceita `trigger: 'hover'` e `'visible'`; `viewContent` default liga os 3 em `[data-track="view_content"]`. `data-trigger` no HTML restringe o modo (`click` / `hover` / `visible`); sem o atributo, dispara nos 3
|
|
15
|
+
- `PixelConfigurationError` para `pixelId` inválido
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- `REMOVE_FROM_CART` usa a mesma janela de 500ms do `ADD_TO_CART` — add → remove → add → remove do mesmo produto volta a disparar
|
|
20
|
+
- `force: true` durante pending destrói a instância anterior (generation token)
|
|
21
|
+
- `window.PixelV2` continua disponível quando `window.Pixel` estrangeiro bloqueia o global
|
|
22
|
+
|
|
3
23
|
## 0.1.0-rc.6 — Public RC docs on npm + install fix
|
|
4
24
|
|
|
5
25
|
### Fixed
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
SDK de analytics e conversão para web — implemente funis (landing, checkout, upsell, thank-you) em React, Next.js, SPA ou HTML puro **sem conhecer a arquitetura interna**.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
A versão publicada está em `package.json`. Instale a tag `@rc` para receber a release candidate atual.
|
|
6
6
|
|
|
7
7
|
## Instalação (npm — sem token)
|
|
8
8
|
|
|
@@ -10,11 +10,9 @@ Pacote **público**. Qualquer dev instala **sem login** no npm:
|
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npm install @beworke/pixel@rc
|
|
13
|
-
# ou versão fixa:
|
|
14
|
-
npm install @beworke/pixel@0.1.0-rc.6
|
|
15
13
|
```
|
|
16
14
|
|
|
17
|
-
> **Importante:** `npm install @beworke/pixel` sem tag usa `latest`. Use `@rc`
|
|
15
|
+
> **Importante:** `npm install @beworke/pixel` sem tag usa `latest`. Use `@rc` até alinhar tags.
|
|
18
16
|
|
|
19
17
|
## Documentação pública
|
|
20
18
|
|
|
@@ -22,59 +20,84 @@ O **npm não hospeda** arquivos `.md` como site (URLs tipo `npmjs.com/.../instal
|
|
|
22
20
|
|
|
23
21
|
| Onde ler | Link |
|
|
24
22
|
|----------|------|
|
|
25
|
-
| **GitHub (recomendado no browser)** | [docs/public/README.md](https://github.com/
|
|
23
|
+
| **GitHub (recomendado no browser)** | [docs/public/README.md](https://github.com/beworke-apps/Pixel-Global/blob/main/packages/pixel/docs/public/README.md) |
|
|
26
24
|
| **Após `npm install`** | `node_modules/@beworke/pixel/docs/public/` |
|
|
27
25
|
|
|
28
26
|
| Guia | GitHub |
|
|
29
27
|
|------|--------|
|
|
30
|
-
| Instalação | [getting-started/installation.md](https://github.com/
|
|
31
|
-
| Quick start | [getting-started/quick-start.md](https://github.com/
|
|
32
|
-
| API Pixel | [api/pixel.md](https://github.com/
|
|
33
|
-
| Eventos | [events/catalog.md](https://github.com/
|
|
34
|
-
| Configuração | [configuration/overview.md](https://github.com/
|
|
35
|
-
| Funis | [guides/funnel-full.md](https://github.com/
|
|
36
|
-
| Privacidade (RC) | [privacy/limitations.md](https://github.com/
|
|
37
|
-
| Limitações | [limitations.md](https://github.com/
|
|
28
|
+
| Instalação | [getting-started/installation.md](https://github.com/beworke-apps/Pixel-Global/blob/main/packages/pixel/docs/public/getting-started/installation.md) |
|
|
29
|
+
| Quick start | [getting-started/quick-start.md](https://github.com/beworke-apps/Pixel-Global/blob/main/packages/pixel/docs/public/getting-started/quick-start.md) |
|
|
30
|
+
| API Pixel | [api/pixel.md](https://github.com/beworke-apps/Pixel-Global/blob/main/packages/pixel/docs/public/api/pixel.md) |
|
|
31
|
+
| Eventos | [events/catalog.md](https://github.com/beworke-apps/Pixel-Global/blob/main/packages/pixel/docs/public/events/catalog.md) |
|
|
32
|
+
| Configuração | [configuration/overview.md](https://github.com/beworke-apps/Pixel-Global/blob/main/packages/pixel/docs/public/configuration/overview.md) |
|
|
33
|
+
| Funis | [guides/funnel-full.md](https://github.com/beworke-apps/Pixel-Global/blob/main/packages/pixel/docs/public/guides/funnel-full.md) |
|
|
34
|
+
| Privacidade (RC) | [privacy/limitations.md](https://github.com/beworke-apps/Pixel-Global/blob/main/packages/pixel/docs/public/privacy/limitations.md) |
|
|
35
|
+
| Limitações | [limitations.md](https://github.com/beworke-apps/Pixel-Global/blob/main/packages/pixel/docs/public/limitations.md) |
|
|
38
36
|
|
|
39
|
-
Repositório: https://github.com/
|
|
37
|
+
Repositório: https://github.com/beworke-apps/Pixel-Global
|
|
40
38
|
|
|
41
|
-
##
|
|
39
|
+
## Três níveis de uso
|
|
40
|
+
|
|
41
|
+
### HTML simples (script tag)
|
|
42
|
+
|
|
43
|
+
Carregar o bundle **apenas registra** `window.Pixel`. Nada é inicializado até `Pixel(settings)` resolver. Top-level `await` exige `type="module"` (ou um IIFE/`then`).
|
|
44
|
+
|
|
45
|
+
```html
|
|
46
|
+
<script src="https://unpkg.com/@beworke/pixel@rc/dist/browser/pixel.global.js"></script>
|
|
47
|
+
<script type="module">
|
|
48
|
+
const pixel = await Pixel({
|
|
49
|
+
identity: { pixelId: 'pix_YOUR_ID' },
|
|
50
|
+
});
|
|
51
|
+
pixel.lead({ email: 'user@example.com' });
|
|
52
|
+
</script>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`Pixel(settings)` usa o bootstrap (uma instância por `window`). `window.PixelV2` permanece como compatibilidade / API de baixo nível.
|
|
56
|
+
|
|
57
|
+
### NPM com factory
|
|
58
|
+
|
|
59
|
+
`createPixel` cria **instâncias independentes** (não é singleton).
|
|
42
60
|
|
|
43
61
|
```typescript
|
|
44
|
-
import {
|
|
62
|
+
import { createPixel } from '@beworke/pixel';
|
|
45
63
|
|
|
46
|
-
const pixel =
|
|
47
|
-
...DEFAULT_PIXEL_CONFIG,
|
|
64
|
+
const pixel = await createPixel({
|
|
48
65
|
identity: { pixelId: 'pix_YOUR_ID' },
|
|
49
|
-
transport: {
|
|
50
|
-
...DEFAULT_PIXEL_CONFIG.transport,
|
|
51
|
-
apiEndpoint: 'https://your-pixel-api.example.com',
|
|
52
|
-
},
|
|
53
|
-
storage: {
|
|
54
|
-
...DEFAULT_PIXEL_CONFIG.storage,
|
|
55
|
-
persistence: {
|
|
56
|
-
visitor: 'localStorage',
|
|
57
|
-
session: 'sessionStorage',
|
|
58
|
-
attribution: 'localStorage',
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
modules: {
|
|
62
|
-
...DEFAULT_PIXEL_CONFIG.modules,
|
|
63
|
-
core: { ...DEFAULT_PIXEL_CONFIG.modules.core, enabled: true },
|
|
64
|
-
transport: {
|
|
65
|
-
...DEFAULT_PIXEL_CONFIG.modules.transport,
|
|
66
|
-
enabled: true,
|
|
67
|
-
sender: { mode: 'api' },
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
66
|
});
|
|
71
67
|
|
|
72
|
-
await pixel.init();
|
|
73
68
|
pixel.lead({ email: 'user@example.com' });
|
|
74
|
-
pixel.purchase({ transactionId: 'ord_1', value: 197, currency: 'BRL' });
|
|
75
|
-
await pixel.destroy();
|
|
76
69
|
```
|
|
77
70
|
|
|
71
|
+
A classe continua disponível:
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import { Pixel } from '@beworke/pixel';
|
|
75
|
+
|
|
76
|
+
const pixel = new Pixel({
|
|
77
|
+
identity: { pixelId: 'pix_YOUR_ID' },
|
|
78
|
+
});
|
|
79
|
+
await pixel.init();
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Browser avançado
|
|
83
|
+
|
|
84
|
+
`bootstrapPixel` gerencia **uma instância por `window`**. Para trocar a configuração, destrua explicitamente ou use `force`. Chamadas concorrentes compartilham a configuração da primeira chamada.
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
import { bootstrapPixel } from '@beworke/pixel/browser';
|
|
88
|
+
|
|
89
|
+
const pixel = await bootstrapPixel(
|
|
90
|
+
{
|
|
91
|
+
identity: { pixelId: 'pix_YOUR_ID' },
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
waitForConsent: () => window.consentGranted === true,
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
React: use [`@beworke/pixel-react`](../pixel-react/README.md) (`PixelProvider` / `usePixel`).
|
|
100
|
+
|
|
78
101
|
## Métodos públicos
|
|
79
102
|
|
|
80
103
|
| Método | Descrição |
|
|
@@ -84,27 +107,19 @@ await pixel.destroy();
|
|
|
84
107
|
| `purchase`, `lead`, `addToCart`, `removeFromCart` | Conversão |
|
|
85
108
|
| `initiateCheckout`, `addPaymentInfo`, `viewContent`, `search` | Conversão |
|
|
86
109
|
|
|
87
|
-
Detalhes: [api/pixel.md](https://github.com/
|
|
88
|
-
|
|
89
|
-
## Script tag (CDN)
|
|
90
|
-
|
|
91
|
-
```html
|
|
92
|
-
<script src="https://unpkg.com/@beworke/pixel@rc/dist/v2/global.global.js"></script>
|
|
93
|
-
<script>
|
|
94
|
-
const { Pixel, DEFAULT_PIXEL_CONFIG } = window.PixelV2;
|
|
95
|
-
</script>
|
|
96
|
-
```
|
|
110
|
+
Detalhes: [api/pixel.md](https://github.com/beworke-apps/Pixel-Global/blob/main/packages/pixel/docs/public/api/pixel.md)
|
|
97
111
|
|
|
98
|
-
|
|
112
|
+
Métodos internos de playground (`@internal`) **não** são API pública.
|
|
99
113
|
|
|
100
114
|
## Limitações do RC
|
|
101
115
|
|
|
102
|
-
-
|
|
116
|
+
- O bundle **não** auto-inicializa; a aplicação controla quando chamar `Pixel(settings)` / `init()`
|
|
117
|
+
- Consent gate opcional no bootstrap — a aplicação decide quando há consentimento suficiente
|
|
103
118
|
- Não declarar GDPR/LGPD/CCPA compliant com este RC
|
|
104
119
|
- Sem eventos dedicados upsell/downsell — use `VIEW_CONTENT` + `PURCHASE`
|
|
105
120
|
|
|
106
|
-
Lista: [limitations.md](https://github.com/
|
|
121
|
+
Lista: [limitations.md](https://github.com/beworke-apps/Pixel-Global/blob/main/packages/pixel/docs/public/limitations.md)
|
|
107
122
|
|
|
108
123
|
## Contribuidores
|
|
109
124
|
|
|
110
|
-
Arquitetura interna: [ARCHITECTURE.md](https://github.com/
|
|
125
|
+
Arquitetura interna: [PLAN_PIXEL/ARCHITECTURE.md](https://github.com/beworke-apps/Pixel-Global/blob/main/PLAN_PIXEL/ARCHITECTURE.md) · Playgrounds: `apps/playground-html/` no monorepo.
|
package/RELEASE_CANDIDATE.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Pixel v2 — Release Candidate Notes
|
|
2
2
|
|
|
3
3
|
**Pacote:** `@beworke/pixel`
|
|
4
|
-
**Versão:** `
|
|
4
|
+
**Versão:** consulte `package.json` (fonte de verdade; este arquivo é histórico do RC)
|
|
5
5
|
**Data:** 2026-07-14
|
|
6
|
-
**Status 20:** **Concluída** — Runtime Intelligence · [`PIXEL_V2_STAGE_20_REPORT.md`](
|
|
6
|
+
**Status 20:** **Concluída** — Runtime Intelligence · [`PLAN_PIXEL/PIXEL_V2_STAGE_20_REPORT.md`](../../../PLAN_PIXEL/PIXEL_V2_STAGE_20_REPORT.md)
|
|
7
7
|
|
|
8
8
|
> Runtime e módulos implementados estão prontos para **validação controlada**.
|
|
9
9
|
> **Próxima etapa oficial: 21 — Commerce lifecycle** (Behavior Runtime Evolution 17–20 concluída).
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
> Será desenvolvido antes da primeira distribuição pública da SDK.
|
|
12
12
|
> **Não** faz parte do Runtime obrigatório da versão 1.0 interna.
|
|
13
13
|
|
|
14
|
-
> Guia do playground: [`
|
|
15
|
-
> Funil completo: [`
|
|
16
|
-
> Backlog: [`PIXEL_V2_BACKLOG_PENDENCIAS_ISOLADO.md`](
|
|
14
|
+
> Guia do playground: [`apps/playground-html/RELEASE_CANDIDATE.md`](../../../apps/playground-html/RELEASE_CANDIDATE.md)
|
|
15
|
+
> Funil completo: [`apps/playground-html/full-funnel/`](../../../apps/playground-html/full-funnel/)
|
|
16
|
+
> Backlog: [`PLAN_PIXEL/PIXEL_V2_BACKLOG_PENDENCIAS_ISOLADO.md`](../../../PLAN_PIXEL/PIXEL_V2_BACKLOG_PENDENCIAS_ISOLADO.md)
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
@@ -58,7 +58,7 @@ Browser destinations (Meta / Google / TikTok)
|
|
|
58
58
|
Attribution
|
|
59
59
|
Commerce + AutoTrack avançado (12A–12M)
|
|
60
60
|
Core UrlContext (15A — query_params, managed/forward, link decoration)
|
|
61
|
-
Playgrounds
|
|
61
|
+
Playgrounds apps/playground-html/*
|
|
62
62
|
Smoke real opcional (env)
|
|
63
63
|
Release candidate HTML + pack validation (13A–13B)
|
|
64
64
|
```
|
|
@@ -79,18 +79,24 @@ npm install @beworke/pixel
|
|
|
79
79
|
|
|
80
80
|
### Tarball local (RC sem publish)
|
|
81
81
|
|
|
82
|
+
Na raiz do monorepo:
|
|
83
|
+
|
|
82
84
|
```bash
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
pnpm pack:pixel
|
|
86
|
+
pnpm validate:pixel-package
|
|
87
|
+
# opcional: instalar o .tgz gerado em artifacts/
|
|
88
|
+
pnpm smoke:pixel-package
|
|
86
89
|
```
|
|
87
90
|
|
|
88
|
-
|
|
91
|
+
O fluxo oficial é **`pnpm pack:pixel`** (escreve em `artifacts/`).
|
|
92
|
+
Não use `pnpm --filter @beworke/pixel pack` como fluxo principal.
|
|
93
|
+
|
|
94
|
+
Validar tarball (usa `artifacts/latest-package.json`):
|
|
89
95
|
|
|
90
96
|
```bash
|
|
91
|
-
|
|
92
|
-
# ou
|
|
93
|
-
node scripts/validate-rc-package.mjs
|
|
97
|
+
pnpm validate:pixel-package
|
|
98
|
+
# ou caminho explícito:
|
|
99
|
+
node scripts/validate-rc-package.mjs artifacts/beworke-pixel-0.1.0-rc.6.tgz
|
|
94
100
|
```
|
|
95
101
|
|
|
96
102
|
---
|
|
@@ -98,58 +104,24 @@ node scripts/validate-rc-package.mjs ./beworke-pixel-0.1.0-rc.5.tgz
|
|
|
98
104
|
## 4. Como usar via import (ESM)
|
|
99
105
|
|
|
100
106
|
```ts
|
|
101
|
-
import {
|
|
107
|
+
import { createPixel } from '@beworke/pixel';
|
|
102
108
|
|
|
103
|
-
const pixel =
|
|
104
|
-
|
|
105
|
-
identity: {
|
|
106
|
-
...DEFAULT_PIXEL_CONFIG.identity,
|
|
107
|
-
pixelId: 'pix_xxx',
|
|
108
|
-
},
|
|
109
|
-
transport: {
|
|
110
|
-
...DEFAULT_PIXEL_CONFIG.transport,
|
|
111
|
-
apiEndpoint: 'https://sua-api.example.com',
|
|
112
|
-
},
|
|
113
|
-
modules: {
|
|
114
|
-
...DEFAULT_PIXEL_CONFIG.modules,
|
|
115
|
-
core: {
|
|
116
|
-
...DEFAULT_PIXEL_CONFIG.modules.core,
|
|
117
|
-
enabled: true,
|
|
118
|
-
pageView: {
|
|
119
|
-
...DEFAULT_PIXEL_CONFIG.modules.core.pageView,
|
|
120
|
-
enabled: true,
|
|
121
|
-
trackInitialPageView: true,
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
conversion: {
|
|
125
|
-
...DEFAULT_PIXEL_CONFIG.modules.conversion,
|
|
126
|
-
enabled: true,
|
|
127
|
-
manual: {
|
|
128
|
-
...DEFAULT_PIXEL_CONFIG.modules.conversion.manual,
|
|
129
|
-
lead: { enabled: true },
|
|
130
|
-
purchase: { enabled: true },
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
transport: {
|
|
134
|
-
...DEFAULT_PIXEL_CONFIG.modules.transport,
|
|
135
|
-
enabled: true,
|
|
136
|
-
mockSender: { enabled: false },
|
|
137
|
-
sender: { mode: 'http' },
|
|
138
|
-
},
|
|
139
|
-
},
|
|
109
|
+
const pixel = await createPixel({
|
|
110
|
+
identity: { pixelId: 'pix_xxx' },
|
|
140
111
|
});
|
|
141
112
|
|
|
142
|
-
await pixel.init();
|
|
143
113
|
// PAGE_VIEW: emitido pelo Core (trackInitialPageView) — não existe pixel.pageView()
|
|
144
114
|
pixel.lead({ email: 'user@example.com' });
|
|
145
115
|
pixel.purchase({ orderId: '1', value: 99.9, currency: 'BRL' });
|
|
146
116
|
await pixel.destroy();
|
|
147
117
|
```
|
|
148
118
|
|
|
119
|
+
Overrides parciais e `PixelConfig` completo continuam válidos. `DEFAULT_PIXEL_CONFIG` permanece para inspeção avançada.
|
|
120
|
+
|
|
149
121
|
### CJS
|
|
150
122
|
|
|
151
123
|
```js
|
|
152
|
-
const {
|
|
124
|
+
const { createPixel } = require('@beworke/pixel');
|
|
153
125
|
```
|
|
154
126
|
|
|
155
127
|
### Subpath `/v2`
|
|
@@ -162,24 +134,20 @@ import { Pixel } from '@beworke/pixel/v2';
|
|
|
162
134
|
|
|
163
135
|
## 5. Como usar via script tag
|
|
164
136
|
|
|
165
|
-
Bundle
|
|
137
|
+
Bundle recomendado: `dist/browser/pixel.global.js` → **`window.Pixel(settings)`**
|
|
166
138
|
|
|
167
139
|
```html
|
|
168
|
-
<script src="./node_modules/@beworke/pixel/dist/
|
|
169
|
-
<script>
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
...DEFAULT_PIXEL_CONFIG,
|
|
173
|
-
identity: { ...DEFAULT_PIXEL_CONFIG.identity, pixelId: 'pix_xxx' },
|
|
174
|
-
transport: {
|
|
175
|
-
...DEFAULT_PIXEL_CONFIG.transport,
|
|
176
|
-
apiEndpoint: 'https://sua-api.example.com',
|
|
177
|
-
},
|
|
140
|
+
<script src="./node_modules/@beworke/pixel/dist/browser/pixel.global.js"></script>
|
|
141
|
+
<script type="module">
|
|
142
|
+
const pixel = await Pixel({
|
|
143
|
+
identity: { pixelId: 'pix_xxx' },
|
|
178
144
|
});
|
|
179
|
-
pixel.
|
|
145
|
+
pixel.lead({ email: 'user@example.com' });
|
|
180
146
|
</script>
|
|
181
147
|
```
|
|
182
148
|
|
|
149
|
+
`window.PixelV2` permanece como compatibilidade / API de baixo nível.
|
|
150
|
+
|
|
183
151
|
Export npm: `@beworke/pixel/global`.
|
|
184
152
|
|
|
185
153
|
---
|
|
@@ -187,20 +155,24 @@ Export npm: `@beworke/pixel/global`.
|
|
|
187
155
|
## 6. Transport real
|
|
188
156
|
|
|
189
157
|
```ts
|
|
190
|
-
|
|
191
|
-
|
|
158
|
+
transport: {
|
|
159
|
+
...DEFAULT_TRANSPORT_CONFIG,
|
|
160
|
+
enabled: true,
|
|
161
|
+
sender: {
|
|
162
|
+
mode: 'internal',
|
|
163
|
+
baseUrl: process.env.PIXEL_API_ENDPOINT,
|
|
164
|
+
},
|
|
165
|
+
batch: {
|
|
166
|
+
...DEFAULT_TRANSPORT_CONFIG.batch,
|
|
192
167
|
enabled: true,
|
|
193
|
-
|
|
194
|
-
sender: { mode: 'http' },
|
|
195
|
-
batch: { enabled: true, batchSize: 1 }, // Event
|
|
196
|
-
// batchSize: 10 → Batch
|
|
168
|
+
batchSize: 1, // Event; use 10 para Batch
|
|
197
169
|
},
|
|
198
170
|
},
|
|
199
|
-
transport: {
|
|
200
|
-
apiEndpoint: process.env.PIXEL_API_ENDPOINT, // não hardcodar em produção
|
|
201
|
-
},
|
|
202
171
|
```
|
|
203
172
|
|
|
173
|
+
Para sender `test`, `internal` sem `baseUrl` e `external`, consulte
|
|
174
|
+
[`docs/public/configuration/transport.md`](./docs/public/configuration/transport.md).
|
|
175
|
+
|
|
204
176
|
Endpoints oficiais do SDK:
|
|
205
177
|
|
|
206
178
|
```txt
|
|
@@ -285,7 +257,7 @@ modules.conversion.auto = {
|
|
|
285
257
|
};
|
|
286
258
|
```
|
|
287
259
|
|
|
288
|
-
Detalhes: `PIXEL_V2_COMMERCE_AUTOTRACK_PLAN.md` · playgrounds em `
|
|
260
|
+
Detalhes: `PLAN_PIXEL/PIXEL_V2_COMMERCE_AUTOTRACK_PLAN.md` · playgrounds em `apps/playground-html/`.
|
|
289
261
|
|
|
290
262
|
---
|
|
291
263
|
|