@drivemetadata-ai/sdk 0.1.1-beta.1 → 0.1.1-beta.2
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/README.md +18 -15
- package/dist/angular/index.cjs +118 -115
- package/dist/angular/index.cjs.map +1 -1
- package/dist/angular/index.d.cts +2 -2
- package/dist/angular/index.d.ts +2 -2
- package/dist/angular/index.js +118 -115
- package/dist/angular/index.js.map +1 -1
- package/dist/browser/index.cjs +119 -116
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +5 -68
- package/dist/browser/index.d.ts +5 -68
- package/dist/browser/index.js +119 -116
- package/dist/browser/index.js.map +1 -1
- package/dist/next/index.cjs +119 -115
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.d.cts +1 -1
- package/dist/next/index.d.ts +1 -1
- package/dist/next/index.js +119 -115
- package/dist/next/index.js.map +1 -1
- package/dist/node/index.cjs +80 -7
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +7 -1
- package/dist/node/index.d.ts +7 -1
- package/dist/node/index.js +80 -7
- package/dist/node/index.js.map +1 -1
- package/dist/react/index.cjs +119 -115
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +2 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +119 -115
- package/dist/react/index.js.map +1 -1
- package/dist/{types-BwtS0ZDu.d.cts → types--V8TVIqT.d.cts} +7 -3
- package/dist/{types-BwtS0ZDu.d.ts → types--V8TVIqT.d.ts} +7 -3
- package/docs/angular-integration.md +6 -6
- package/docs/index.md +4 -6
- package/docs/integration.md +322 -0
- package/docs/node-server-integration.md +16 -7
- package/docs/npm-browser-sdk.md +4 -8
- package/docs/react-next-integration.md +9 -9
- package/docs/security-privacy.md +11 -11
- package/package.json +4 -5
- package/docs/migration-cdn-to-npm.md +0 -99
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
# CDN to NPM Migration
|
|
2
|
-
|
|
3
|
-
The existing CDN script remains supported:
|
|
4
|
-
|
|
5
|
-
```html
|
|
6
|
-
<script src="https://example-cdn/drivemetadata/dmdSDK_v3.js"></script>
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
The npm SDK adds typed imports and framework adapters.
|
|
10
|
-
|
|
11
|
-
## Before
|
|
12
|
-
|
|
13
|
-
```html
|
|
14
|
-
<script src="/dmdSDK_v3.js"></script>
|
|
15
|
-
<script>
|
|
16
|
-
window.dmdSDK = new window.DriveMetaDataSDK({
|
|
17
|
-
client_id: 'client_xxx',
|
|
18
|
-
workspace_id: 'workspace_xxx',
|
|
19
|
-
app_id: 'app_xxx',
|
|
20
|
-
writeKey: 'public_write_key',
|
|
21
|
-
consent: { analytics: 'granted', advertising: 'denied' }
|
|
22
|
-
});
|
|
23
|
-
window.dmdSDK.trackEvent('Product Viewed', { sku: 'sku_123' });
|
|
24
|
-
</script>
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## After
|
|
28
|
-
|
|
29
|
-
```ts
|
|
30
|
-
import { initDmdSDK, track } from '@drivemetadata/sdk/browser';
|
|
31
|
-
|
|
32
|
-
initDmdSDK({
|
|
33
|
-
clientId: 'client_xxx',
|
|
34
|
-
workspaceId: 'workspace_xxx',
|
|
35
|
-
appId: 'app_xxx',
|
|
36
|
-
writeKey: 'public_write_key',
|
|
37
|
-
consent: { analytics: 'granted', advertising: 'denied' }
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
track('Product Viewed', { sku: 'sku_123' });
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Config Mapping
|
|
44
|
-
|
|
45
|
-
| CDN config | NPM config |
|
|
46
|
-
| --- | --- |
|
|
47
|
-
| `client_id` | `clientId` |
|
|
48
|
-
| `workspace_id` | `workspaceId` |
|
|
49
|
-
| `app_id` | `appId` |
|
|
50
|
-
| `token` | `writeKey` |
|
|
51
|
-
| `api_host` | `apiHost` |
|
|
52
|
-
| `capture_pageview` | `capturePageview` |
|
|
53
|
-
| `capture_pageleave` | `capturePageleave` |
|
|
54
|
-
| `capture_dead_clicks` | `captureDeadClicks` |
|
|
55
|
-
| `disable_persistence` | `disablePersistence` |
|
|
56
|
-
| `mask_all_text` | `maskAllText` |
|
|
57
|
-
| `mask_all_element_attributes` | `maskAllElementAttributes` |
|
|
58
|
-
|
|
59
|
-
## Compatibility
|
|
60
|
-
|
|
61
|
-
The npm browser entry no longer requires a global CDN constructor. The global CDN script path remains available for customers who cannot move to npm immediately.
|
|
62
|
-
|
|
63
|
-
## Behavior Parity Contract
|
|
64
|
-
|
|
65
|
-
| Behavior | CDN `dmdSDK_v3.js` | npm browser SDK | Release Requirement |
|
|
66
|
-
|---|---|---|---|
|
|
67
|
-
| `track` | Sends event payload with configured client/workspace/app IDs | Same public event semantics | Covered by parity fixture |
|
|
68
|
-
| `page` | Supports page view tracking | Same public page API | Covered by parity fixture |
|
|
69
|
-
| `identify` | Associates user traits | Same public identify API | Covered by parity fixture |
|
|
70
|
-
| `group` | Associates account/group traits when available | Same public group API | Covered by parity fixture |
|
|
71
|
-
| `alias` | Links previous and current IDs when available | Same public alias API | Covered by parity fixture |
|
|
72
|
-
| Consent denied | Drops analytics events | Drops analytics events and purges queue | Covered by consent tests |
|
|
73
|
-
| Offline failure | Queues where supported | Persists queue in browser storage | Covered by delivery tests |
|
|
74
|
-
| PII masking | Legacy masking behavior | Recursive property sanitization | Covered by privacy tests |
|
|
75
|
-
|
|
76
|
-
## Legacy Parity Release Rule
|
|
77
|
-
|
|
78
|
-
Before public npm release, the parity fixture suite must cover:
|
|
79
|
-
|
|
80
|
-
- track
|
|
81
|
-
- page
|
|
82
|
-
- identify
|
|
83
|
-
- group
|
|
84
|
-
- alias
|
|
85
|
-
- consent denied
|
|
86
|
-
- consent revocation queue purge
|
|
87
|
-
- nested PII redaction
|
|
88
|
-
- offline queue persistence
|
|
89
|
-
- reset cleanup
|
|
90
|
-
|
|
91
|
-
The CDN script remains supported during migration. New framework integrations should use npm entry points.
|
|
92
|
-
|
|
93
|
-
Behavior differences:
|
|
94
|
-
|
|
95
|
-
- `track()` uses the SDK event enrichment and delivery path.
|
|
96
|
-
- Browser `token` terminology is replaced by `writeKey`.
|
|
97
|
-
- Runtime purpose-level consent can be updated with `consent.update()`.
|
|
98
|
-
- npm browser analytics defaults to `pending` when consent is omitted.
|
|
99
|
-
- Health diagnostics are available through `getDmdHealth()`.
|