@beworke/pixel 0.1.0-rc.7 → 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 +28 -62
- package/dist/Pixel-CCgGk43j.d.ts +797 -0
- package/dist/Pixel-CqbgC_72.d.mts +797 -0
- package/dist/{StorageFactory-DeMaZ8wk.d.ts → StorageFactory-BRBsnnH7.d.ts} +1 -1
- package/dist/{StorageFactory-Cq29vF32.d.mts → StorageFactory-Dp19Wecr.d.mts} +1 -1
- 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 +15 -5
- package/dist/config/index.d.ts +15 -5
- package/dist/config/index.esm.js +1 -1
- package/dist/config/index.esm.js.map +1 -1
- package/dist/examples/html-script/RELEASE_CANDIDATE.md +6 -8
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-autocomplete.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-disabled.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-card-fields.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-data-track.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-dedupe.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-manual.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-rules-card.html +40 -47
- package/dist/examples/html-script/add-payment-info/example-add-payment-info-security.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-attribute.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-auto.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-click.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-dedupe.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-link.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-manual.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-order-bump.html +40 -47
- package/dist/examples/html-script/add-to-cart/example-add-to-cart-text.html +40 -47
- package/dist/examples/html-script/behavior/example-behavior-engagement.html +4 -4
- package/dist/examples/html-script/behavior/example-behavior-heartbeat.html +4 -4
- package/dist/examples/html-script/behavior/example-behavior-runtime-intelligence.html +4 -4
- package/dist/examples/html-script/behavior/example-behavior-viewport.html +4 -4
- package/dist/examples/html-script/buygoods/example-buygoods-checkout.html +83 -0
- package/dist/examples/html-script/example-checkout-commerce.html +31 -30
- package/dist/examples/html-script/example-conversion.html +41 -48
- 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 +39 -45
- package/dist/examples/html-script/example-landing-commerce.html +3 -8
- package/dist/examples/html-script/example-runtime-diagnostics.html +4 -4
- package/dist/examples/html-script/example-transport.html +59 -57
- package/dist/examples/html-script/full-funnel/checkout.html +3 -1
- package/dist/examples/html-script/full-funnel/downsell.html +3 -1
- package/dist/examples/html-script/full-funnel/landing.html +3 -1
- package/dist/examples/html-script/full-funnel/thank-you.html +3 -1
- package/dist/examples/html-script/full-funnel/upsell.html +3 -1
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-attribute.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-auto.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-click.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-manual.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-snapshot.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-submit.html +40 -47
- package/dist/examples/html-script/initiate-checkout/example-initiate-checkout-text.html +40 -47
- package/dist/examples/html-script/lead/example-lead-trigger-attribute.html +40 -47
- package/dist/examples/html-script/lead/example-lead-trigger-auto.html +40 -47
- package/dist/examples/html-script/lead/example-lead-trigger-click.html +40 -47
- package/dist/examples/html-script/release-candidate.html +31 -30
- 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 +40 -47
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-css.html +40 -47
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-dedupe.html +47 -54
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-manual.html +40 -47
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-multi.html +40 -47
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-state.html +40 -47
- package/dist/examples/html-script/remove-from-cart/example-remove-from-cart-text.html +40 -47
- package/dist/examples/html-script/search/example-search-attribute.html +40 -47
- package/dist/examples/html-script/search/example-search-button-sync.html +40 -47
- package/dist/examples/html-script/search/example-search-dedupe.html +40 -47
- package/dist/examples/html-script/search/example-search-input.html +40 -47
- package/dist/examples/html-script/search/example-search-manual.html +40 -47
- package/dist/examples/html-script/search/example-search-submit.html +40 -47
- package/dist/examples/html-script/search/example-search-text.html +40 -47
- package/dist/examples/html-script/url-context/example-url-context-allowed-domains.html +4 -4
- package/dist/examples/html-script/url-context/example-url-context-landing.html +4 -4
- package/dist/examples/html-script/url-context/example-url-context-upsell.html +4 -4
- package/dist/examples/html-script/url-context/example-url-context.html +4 -4
- package/dist/examples/html-script/view-content/example-view-content-attribute.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-css.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-dedupe.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-empty.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-manual.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-product-card.html +40 -47
- package/dist/examples/html-script/view-content/example-view-content-text.html +40 -47
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.mts +8 -6
- package/dist/index.d.ts +8 -6
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/{pixel-DMwpppf_.d.mts → pixel-C93c-0M2.d.mts} +109 -97
- package/dist/{pixel-2uL4LSyC.d.ts → pixel-DVy4rzj8.d.ts} +109 -97
- 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 +4 -4
- package/dist/runtime/index.d.ts +4 -4
- 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 +4 -4
- package/dist/services/index.d.ts +4 -4
- package/dist/services/index.esm.js +1 -1
- package/dist/services/index.esm.js.map +1 -1
- package/dist/{types-BqUEoZo0.d.ts → types-B2aUNHb3.d.ts} +2 -2
- package/dist/{types-6HF3UlsL.d.mts → types-C0J9KUQg.d.mts} +2 -2
- package/dist/{types-CgrabttM.d.mts → types-C2dsBog1.d.mts} +1 -1
- package/dist/{types-fFcQ1apy.d.ts → types-DcaBYgVI.d.ts} +1 -1
- 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 +21 -787
- package/dist/v2/index.d.ts +21 -787
- package/dist/v2/index.esm.js +1 -1
- package/dist/v2/index.esm.js.map +1 -1
- package/docs/public/README.md +7 -4
- package/docs/public/api/exports.md +12 -8
- package/docs/public/api/pixel.md +27 -6
- package/docs/public/configuration/commerce.md +2 -2
- 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 +14 -12
- 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 +1 -1
- package/docs/public/guides/funnel-landing.md +9 -7
- package/docs/public/limitations.md +5 -4
- package/docs/public/privacy/limitations.md +6 -6
- package/docs/public/release-candidate/validation.md +4 -4
- package/docs/public/troubleshooting.md +7 -6
- package/package.json +8 -3
- package/dist/pixel-default-config-BDPUVHse.d.ts +0 -5
- package/dist/pixel-default-config-C5uLt52W.d.mts +0 -5
|
@@ -1,55 +1,78 @@
|
|
|
1
1
|
# React e Next.js (App Router)
|
|
2
2
|
|
|
3
|
-
O
|
|
3
|
+
O pacote recomendado é [`@beworke/pixel-react`](../../../../pixel-react/README.md): `PixelProvider` + `usePixel` sobre `bootstrapPixel`.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Esta camada **não** duplica `lead` / `purchase` no Context. O hook devolve a instância real de `Pixel`. O playground Next Bemony continua na integração de domínio e **não** usa este pacote genérico.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Instalação
|
|
8
8
|
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import { Pixel } from '@beworke/pixel';
|
|
13
|
-
import { useEffect, useRef, useState } from 'react';
|
|
14
|
-
import { createPixelConfig } from './pixel-config';
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @beworke/pixel-react@rc @beworke/pixel@rc
|
|
11
|
+
```
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
const pixelRef = useRef<Pixel | null>(null);
|
|
18
|
-
const [ready, setReady] = useState(false);
|
|
13
|
+
## Provider
|
|
19
14
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
pixelRef.current = pixel;
|
|
15
|
+
```tsx
|
|
16
|
+
'use client';
|
|
23
17
|
|
|
24
|
-
|
|
18
|
+
import { PixelProvider } from '@beworke/pixel-react';
|
|
19
|
+
import type { PixelSettings } from '@beworke/pixel';
|
|
25
20
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
setReady(false);
|
|
30
|
-
};
|
|
31
|
-
}, []);
|
|
21
|
+
const settings = {
|
|
22
|
+
identity: { pixelId: 'pix_YOUR_ID' },
|
|
23
|
+
} satisfies PixelSettings;
|
|
32
24
|
|
|
33
|
-
|
|
25
|
+
export function Providers({ children }: { children: React.ReactNode }) {
|
|
26
|
+
return <PixelProvider settings={settings}>{children}</PixelProvider>;
|
|
34
27
|
}
|
|
35
28
|
```
|
|
36
29
|
|
|
37
|
-
|
|
30
|
+
`settings` é `PixelSettings`. Somente `identity.pixelId` é obrigatório; o Core resolve o restante.
|
|
31
|
+
|
|
32
|
+
## Hook
|
|
38
33
|
|
|
39
|
-
|
|
34
|
+
```tsx
|
|
35
|
+
'use client';
|
|
40
36
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
import { usePixel } from '@beworke/pixel-react';
|
|
38
|
+
|
|
39
|
+
export function LeadButton() {
|
|
40
|
+
const { pixel, ready, status, error } = usePixel();
|
|
41
|
+
|
|
42
|
+
if (status === 'initializing') {
|
|
43
|
+
return <span>Inicializando...</span>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (error) {
|
|
47
|
+
return <span>Falha ao inicializar o Pixel.</span>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<button
|
|
52
|
+
disabled={!ready}
|
|
53
|
+
onClick={() => {
|
|
54
|
+
pixel?.lead({ email: 'user@example.com' });
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
Enviar lead
|
|
58
|
+
</button>
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
```
|
|
44
62
|
|
|
45
63
|
## SSR
|
|
46
64
|
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
65
|
+
- `PixelProvider` é Client Component (`'use client'`).
|
|
66
|
+
- O `layout.tsx` pode permanecer Server Component.
|
|
67
|
+
- Importar o pacote não acessa `window`.
|
|
68
|
+
- Bootstrap só no `useEffect` do cliente.
|
|
69
|
+
|
|
70
|
+
## Strict Mode e múltiplos Providers
|
|
71
|
+
|
|
72
|
+
Vários Providers na mesma `window` compartilham a instância. Strict Mode (mount → cleanup → mount) não destrói a instância reutilizada; o último unmount real destrói o bootstrap.
|
|
50
73
|
|
|
51
|
-
|
|
74
|
+
`settings` é capturado na montagem. Reinit dinâmico está fora do MVP.
|
|
52
75
|
|
|
53
|
-
|
|
76
|
+
## Alternativa: instância local
|
|
54
77
|
|
|
55
|
-
|
|
78
|
+
Apps que precisam de uma instância isolada (sem singleton da `window`) podem continuar usando `createPixel` ou `new Pixel(settings)` num `useEffect` próprio. Nesse caso o app é dono de `destroy()`.
|
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
## Build
|
|
4
4
|
|
|
5
|
-
O subpath `@beworke/pixel/global` expõe um bundle IIFE
|
|
5
|
+
O subpath `@beworke/pixel/global` expõe um bundle IIFE autossuficiente.
|
|
6
6
|
|
|
7
|
-
Após
|
|
7
|
+
Após o build, o artefato recomendado é `dist/browser/pixel.global.js`. O bundle legado `dist/v2/global.global.js` (`window.PixelV2`) permanece para compatibilidade.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Carregar o script **apenas registra** a API. Não há auto-init, leitura de `document.currentScript` nem atributos `data-*`.
|
|
10
|
+
|
|
11
|
+
## HTML mínimo (`type="module"`)
|
|
12
|
+
|
|
13
|
+
Top-level `await` exige `type="module"`.
|
|
10
14
|
|
|
11
15
|
```html
|
|
12
16
|
<!DOCTYPE html>
|
|
@@ -14,44 +18,63 @@ Após `npm run build`, o artefato está em `dist/global/` (nome conforme `tsup`
|
|
|
14
18
|
<head>
|
|
15
19
|
<meta charset="UTF-8" />
|
|
16
20
|
<title>Pixel — script tag</title>
|
|
21
|
+
<script src="https://unpkg.com/@beworke/pixel@rc/dist/browser/pixel.global.js"></script>
|
|
17
22
|
</head>
|
|
18
23
|
<body>
|
|
19
|
-
<
|
|
20
|
-
<script>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
transport: {
|
|
29
|
-
...DEFAULT_PIXEL_CONFIG.transport,
|
|
30
|
-
apiEndpoint: 'https://your-pixel-api.example.com',
|
|
31
|
-
},
|
|
32
|
-
storage: {
|
|
33
|
-
...DEFAULT_PIXEL_CONFIG.storage,
|
|
34
|
-
persistence: {
|
|
35
|
-
visitor: 'localStorage',
|
|
36
|
-
session: 'sessionStorage',
|
|
37
|
-
attribution: 'localStorage',
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
await pixel.init();
|
|
43
|
-
// Conversões manuais quando necessário
|
|
44
|
-
})();
|
|
24
|
+
<button id="lead-button" type="button">Enviar lead</button>
|
|
25
|
+
<script type="module">
|
|
26
|
+
const pixel = await Pixel({
|
|
27
|
+
identity: { pixelId: 'pix_YOUR_ID' },
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
document.getElementById('lead-button').addEventListener('click', () => {
|
|
31
|
+
pixel.lead({ email: 'user@example.com' });
|
|
32
|
+
});
|
|
45
33
|
</script>
|
|
46
34
|
</body>
|
|
47
35
|
</html>
|
|
48
36
|
```
|
|
49
37
|
|
|
50
|
-
##
|
|
38
|
+
## Script clássico (sem top-level await)
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<script>
|
|
42
|
+
Pixel({
|
|
43
|
+
identity: {
|
|
44
|
+
pixelId: 'pix_YOUR_ID',
|
|
45
|
+
},
|
|
46
|
+
})
|
|
47
|
+
.then(function (pixel) {
|
|
48
|
+
pixel.lead({ email: 'user@example.com' });
|
|
49
|
+
})
|
|
50
|
+
.catch(function (error) {
|
|
51
|
+
console.error(error);
|
|
52
|
+
});
|
|
53
|
+
</script>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## API global
|
|
57
|
+
|
|
58
|
+
```js
|
|
59
|
+
await Pixel(settings); // bootstrap (uma instância por window)
|
|
60
|
+
await Pixel.create(settings); // instância independente
|
|
61
|
+
await Pixel.bootstrap(settings, { force: true, waitForConsent });
|
|
62
|
+
Pixel.getInstance();
|
|
63
|
+
Pixel.getPending();
|
|
64
|
+
await Pixel.destroy();
|
|
65
|
+
new Pixel.Client(settings); // classe; o construtor resolve PixelSettings
|
|
66
|
+
Pixel.DEFAULT_PIXEL_CONFIG; // inspeção / configuração avançada
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`window.PixelV2` continua como compatibilidade / baixo nível (`Pixel`, `DEFAULT_PIXEL_CONFIG`, `resolveStorageAdapterName`, `createPixel`, `bootstrap`, `getInstance`, `destroy`).
|
|
70
|
+
|
|
71
|
+
## Exemplos no monorepo
|
|
51
72
|
|
|
52
|
-
|
|
73
|
+
- `apps/playground-html/example-global-factory.html`
|
|
74
|
+
- `apps/playground-html/example-global-factory-classic.html`
|
|
53
75
|
|
|
54
76
|
## Limitações
|
|
55
77
|
|
|
56
78
|
- TypeScript/IDE não inferem tipos no global — use JSDoc ou migre para npm ESM em apps maiores.
|
|
57
|
-
-
|
|
79
|
+
- A aplicação controla **quando** chamar `Pixel(settings)` após consentimento.
|
|
80
|
+
- Não declare conformidade LGPD/GDPR/CCPA apenas por usar este bundle.
|
|
@@ -6,7 +6,7 @@ Rastrear início de checkout, carrinho, pagamento e compra.
|
|
|
6
6
|
|
|
7
7
|
## Config
|
|
8
8
|
|
|
9
|
-
- `commerce.
|
|
9
|
+
- catálogo de produtos em `commerce.catalog` (enrichment já está on por default)
|
|
10
10
|
- `identity.checkoutId`, `funnelStepId`
|
|
11
11
|
- Transport API habilitado
|
|
12
12
|
|
|
@@ -7,6 +7,13 @@ Medir visita, comportamento na página e leads antes do checkout.
|
|
|
7
7
|
## Config recomendada
|
|
8
8
|
|
|
9
9
|
```typescript
|
|
10
|
+
import { DEFAULT_TRANSPORT_CONFIG } from '@beworke/pixel/config';
|
|
11
|
+
|
|
12
|
+
transport: {
|
|
13
|
+
...DEFAULT_TRANSPORT_CONFIG,
|
|
14
|
+
enabled: true,
|
|
15
|
+
sender: { mode: 'internal' },
|
|
16
|
+
},
|
|
10
17
|
modules: {
|
|
11
18
|
...DEFAULT_PIXEL_CONFIG.modules,
|
|
12
19
|
core: { ...DEFAULT_PIXEL_CONFIG.modules.core, enabled: true },
|
|
@@ -20,11 +27,6 @@ modules: {
|
|
|
20
27
|
exitIntent: { enabled: true },
|
|
21
28
|
},
|
|
22
29
|
},
|
|
23
|
-
transport: {
|
|
24
|
-
...DEFAULT_PIXEL_CONFIG.modules.transport,
|
|
25
|
-
enabled: true,
|
|
26
|
-
sender: { mode: 'api' },
|
|
27
|
-
},
|
|
28
30
|
},
|
|
29
31
|
```
|
|
30
32
|
|
|
@@ -52,7 +54,7 @@ Opcional: `modules.conversion.auto` + detector `lead` com seletores do formulár
|
|
|
52
54
|
|
|
53
55
|
## QA
|
|
54
56
|
|
|
55
|
-
- [ ] `pixelId` e `
|
|
57
|
+
- [ ] `pixelId` e sender (`internal`/`external`) corretos
|
|
56
58
|
- [ ] Persistência `sessionStorage` para sessão
|
|
57
59
|
- [ ] Um único `init()` por aba
|
|
58
60
|
- [ ] `getDebugSnapshot()` mostra transport enviando (dev)
|
|
@@ -61,7 +63,7 @@ Opcional: `modules.conversion.auto` + detector `lead` com seletores do formulár
|
|
|
61
63
|
|
|
62
64
|
| Problema | Causa | Solução |
|
|
63
65
|
|----------|-------|---------|
|
|
64
|
-
| Sem eventos na API | `transport.enabled: false` ou
|
|
66
|
+
| Sem eventos na API | `transport.enabled: false` ou sender `test` | Habilitar Transport + sender `internal`/`external` |
|
|
65
67
|
| Sessão zera no reload | Sem `storage.persistence.session` | Configurar `sessionStorage` |
|
|
66
68
|
| Duplo `PAGE_VIEW` | Dois `init()` | Singleton / cleanup `destroy()` |
|
|
67
69
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
# Limitações conhecidas do RC
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A versão publicada está em `package.json`. Este documento descreve limitações do produto, não um número de RC.
|
|
4
4
|
|
|
5
5
|
## Produto
|
|
6
6
|
|
|
7
7
|
| Limitação | Detalhe |
|
|
8
8
|
|-----------|---------|
|
|
9
|
-
| Consent / CMP | Incompleto —
|
|
9
|
+
| Consent / CMP | Incompleto — a aplicação controla quando inicializar; `waitForConsent` é um gate opcional no bootstrap |
|
|
10
|
+
| Auto-init | O bundle base **não** auto-inicializa ao ser carregado |
|
|
10
11
|
| Commerce Lifecycle | Etapa 21 não iniciada neste RC documental |
|
|
11
12
|
| Eventos upsell/downsell | Sem tipos dedicados; use `VIEW_CONTENT` + `PURCHASE` |
|
|
12
13
|
| `./diagnostics` | Não é export do pacote |
|
|
@@ -17,8 +18,8 @@ Versão: `0.1.0-rc.5` · Etapas 1–20 concluídas.
|
|
|
17
18
|
| Limitação | Detalhe |
|
|
18
19
|
|-----------|---------|
|
|
19
20
|
| `modules.behavior.enabled` | `false` por default — habilitar explicitamente |
|
|
20
|
-
| `modules.
|
|
21
|
-
| Sessão
|
|
21
|
+
| `modules.conversion.auto` | Auto detectors e rules continuam off; só a API manual vem ligada |
|
|
22
|
+
| Sessão | Persistência default em `sessionStorage` |
|
|
22
23
|
|
|
23
24
|
## Distribuição
|
|
24
25
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
# Privacidade e consentimento (RC)
|
|
2
2
|
|
|
3
|
-
## Estado
|
|
3
|
+
## Estado atual
|
|
4
4
|
|
|
5
5
|
- **Não há Consent Gate / CMP completo** integrado ao SDK.
|
|
6
|
+
- `bootstrapPixel(..., { waitForConsent })` e `PixelProvider` permitem abortar **antes** de criar a instância.
|
|
6
7
|
- `modules.core.consent` e `modules.privacy.consent` existem na config mas **defaults desligados**.
|
|
7
|
-
-
|
|
8
|
+
- O chamador controla o momento da inicialização. Este RC **não** declara conformidade LGPD/GDPR/CCPA.
|
|
8
9
|
|
|
9
10
|
## Responsabilidade da aplicação
|
|
10
11
|
|
|
11
|
-
1. **Quando inicializar** — só chame `pixel.init()` após obter consentimento do usuário, se exigido pela sua política.
|
|
12
|
+
1. **Quando inicializar** — só chame `Pixel(settings)`, `createPixel()` ou `pixel.init()` após obter consentimento do usuário, se exigido pela sua política.
|
|
12
13
|
2. **Banner / CMP** — implemente no app (React, HTML, tag manager). O Pixel não substitui ferramenta de consentimento.
|
|
13
14
|
3. **PII** — `modules.privacy.pii` (hash email/phone) off por default; você controla o que envia em `lead()` etc.
|
|
14
15
|
|
|
@@ -21,11 +22,10 @@
|
|
|
21
22
|
|
|
22
23
|
```typescript
|
|
23
24
|
async function onUserConsentGranted() {
|
|
24
|
-
const pixel =
|
|
25
|
-
await pixel.init();
|
|
25
|
+
const pixel = await createPixel(createConfig());
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
// Antes do consentimento: não
|
|
28
|
+
// Antes do consentimento: não chamar Pixel(settings) / createPixel() / init()
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
## Próximos passos (roadmap)
|
|
@@ -22,19 +22,19 @@ Não use `pnpm --filter @beworke/pixel pack` como fluxo principal.
|
|
|
22
22
|
|
|
23
23
|
## Tarball
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
O nome do tarball segue a versão de `package.json` (veja `artifacts/latest-package.json`).
|
|
26
26
|
Manifesto: `artifacts/latest-package.json` (caminho relativo portátil).
|
|
27
27
|
|
|
28
28
|
Instalação em projeto limpo:
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
npm install /caminho/para/artifacts/beworke-pixel
|
|
31
|
+
npm install /caminho/para/artifacts/beworke-pixel-<versão>.tgz
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
## Checklist rápido
|
|
35
35
|
|
|
36
|
-
- [ ] Exports `.`, `./global`, `./v2`, `./config`, `./events`, `./services`, `./runtime`, `./logger`
|
|
37
|
-
- [ ] `window.PixelV2` no build global
|
|
36
|
+
- [ ] Exports `.`, `./browser`, `./global`, `./v2`, `./config`, `./events`, `./services`, `./runtime`, `./logger`
|
|
37
|
+
- [ ] `window.Pixel` (factory) e `window.PixelV2` (compat) no build global
|
|
38
38
|
- [ ] Exemplos públicos sem `@internal` / sem import de `src/`
|
|
39
39
|
- [ ] Links em `packages/pixel/docs/public/` válidos
|
|
40
40
|
- [ ] README aponta para `packages/pixel/docs/public/`
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Nenhum evento chega na API
|
|
4
4
|
|
|
5
|
-
1. Confirme `transport.
|
|
6
|
-
2. `
|
|
7
|
-
3.
|
|
8
|
-
4. `
|
|
9
|
-
5.
|
|
5
|
+
1. Confirme `transport.enabled: true`
|
|
6
|
+
2. Use `transport.sender.mode: 'internal'` ou `'external'` (`'test'` não acessa a rede)
|
|
7
|
+
3. Em `internal`, confira o `baseUrl` opcional; sem ele, vale o endpoint público padrão
|
|
8
|
+
4. Em `external`, confira `endpoints.event` e a política de batch
|
|
9
|
+
5. Confirme `identity.pixelId`
|
|
10
|
+
6. DevTools → Network: requisições ao endpoint
|
|
10
11
|
|
|
11
12
|
## `init()` falha ou trava
|
|
12
13
|
|
|
@@ -51,5 +52,5 @@ npm run validate:rc-package
|
|
|
51
52
|
## Links úteis
|
|
52
53
|
|
|
53
54
|
- [Configuração](./configuration/overview.md)
|
|
54
|
-
- [Transport
|
|
55
|
+
- [Transport](./configuration/transport.md)
|
|
55
56
|
- [Validação RC](./release-candidate/validation.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beworke/pixel",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.8",
|
|
4
4
|
"description": "Pixel v2 — SDK de analytics e conversão para API própria e destinos browser",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -11,8 +11,13 @@
|
|
|
11
11
|
"import": "./dist/index.esm.js",
|
|
12
12
|
"require": "./dist/index.cjs.js"
|
|
13
13
|
},
|
|
14
|
+
"./browser": {
|
|
15
|
+
"types": "./dist/browser/index.d.ts",
|
|
16
|
+
"import": "./dist/browser/index.esm.js",
|
|
17
|
+
"require": "./dist/browser/index.cjs.js"
|
|
18
|
+
},
|
|
14
19
|
"./global": {
|
|
15
|
-
"default": "./dist/
|
|
20
|
+
"default": "./dist/browser/pixel.global.js"
|
|
16
21
|
},
|
|
17
22
|
"./config": {
|
|
18
23
|
"types": "./dist/config/index.d.ts",
|
|
@@ -61,7 +66,7 @@
|
|
|
61
66
|
"validate:rc-package": "node ../../scripts/validate-rc-package.mjs",
|
|
62
67
|
"validate:public-docs": "node ../../scripts/validate-public-docs.mjs",
|
|
63
68
|
"validate:public-examples": "node ../../scripts/validate-public-examples.mjs",
|
|
64
|
-
"publish:rc": "
|
|
69
|
+
"publish:rc": "pnpm publish --access public --tag rc --no-git-checks && node -e \"require('child_process').execSync('npm dist-tag add @beworke/pixel@'+require('./package.json').version+' latest',{stdio:'inherit'})\"",
|
|
65
70
|
"test:integration": "vitest run src/integration",
|
|
66
71
|
"test:transport": "vitest run src/transport",
|
|
67
72
|
"test:full-funnel": "vitest run src/modules/core/url-context src/integration/stage-15b-module-matrix.test.ts",
|