@zaplier/sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +144 -0
- package/dist/index.cjs +11092 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +1204 -0
- package/dist/index.esm.js +11059 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +3517 -0
- package/dist/index.js.map +1 -0
- package/dist/sdk.js +11098 -0
- package/dist/sdk.js.map +1 -0
- package/dist/sdk.min.js +7 -0
- package/dist/src/index.d.ts +15 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/modules/anti-adblock.d.ts +108 -0
- package/dist/src/modules/anti-adblock.d.ts.map +1 -0
- package/dist/src/modules/bot-detection.d.ts +15 -0
- package/dist/src/modules/bot-detection.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/accessibility.d.ts +155 -0
- package/dist/src/modules/fingerprint/accessibility.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/audio.d.ts +16 -0
- package/dist/src/modules/fingerprint/audio.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/browser-apis.d.ts +108 -0
- package/dist/src/modules/fingerprint/browser-apis.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/browser.d.ts +14 -0
- package/dist/src/modules/fingerprint/browser.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/canvas.d.ts +14 -0
- package/dist/src/modules/fingerprint/canvas.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/confidence.d.ts +89 -0
- package/dist/src/modules/fingerprint/confidence.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/datetime-locale.d.ts +76 -0
- package/dist/src/modules/fingerprint/datetime-locale.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/device-signals.d.ts +29 -0
- package/dist/src/modules/fingerprint/device-signals.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/dom-blockers.d.ts +56 -0
- package/dist/src/modules/fingerprint/dom-blockers.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/font-preferences.d.ts +55 -0
- package/dist/src/modules/fingerprint/font-preferences.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/fonts-enhanced.d.ts +43 -0
- package/dist/src/modules/fingerprint/fonts-enhanced.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/fonts.d.ts +14 -0
- package/dist/src/modules/fingerprint/fonts.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/hardware.d.ts +40 -0
- package/dist/src/modules/fingerprint/hardware.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/hashing.d.ts +28 -0
- package/dist/src/modules/fingerprint/hashing.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/incognito.d.ts +6 -0
- package/dist/src/modules/fingerprint/incognito.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/math-enhanced.d.ts +70 -0
- package/dist/src/modules/fingerprint/math-enhanced.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/math.d.ts +32 -0
- package/dist/src/modules/fingerprint/math.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/plugins-enhanced.d.ts +97 -0
- package/dist/src/modules/fingerprint/plugins-enhanced.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/screen.d.ts +15 -0
- package/dist/src/modules/fingerprint/screen.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/storage.d.ts +45 -0
- package/dist/src/modules/fingerprint/storage.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/system.d.ts +40 -0
- package/dist/src/modules/fingerprint/system.d.ts.map +1 -0
- package/dist/src/modules/fingerprint/webgl.d.ts +15 -0
- package/dist/src/modules/fingerprint/webgl.d.ts.map +1 -0
- package/dist/src/modules/fingerprint.d.ts +35 -0
- package/dist/src/modules/fingerprint.d.ts.map +1 -0
- package/dist/src/modules/global-interface.d.ts +141 -0
- package/dist/src/modules/global-interface.d.ts.map +1 -0
- package/dist/src/modules/heatmap.d.ts +140 -0
- package/dist/src/modules/heatmap.d.ts.map +1 -0
- package/dist/src/modules/incognito-detection.d.ts +23 -0
- package/dist/src/modules/incognito-detection.d.ts.map +1 -0
- package/dist/src/modules/session-replay.d.ts +132 -0
- package/dist/src/modules/session-replay.d.ts.map +1 -0
- package/dist/src/modules/user-agent.d.ts +35 -0
- package/dist/src/modules/user-agent.d.ts.map +1 -0
- package/dist/src/sdk.d.ts +227 -0
- package/dist/src/sdk.d.ts.map +1 -0
- package/dist/src/types/config.d.ts +44 -0
- package/dist/src/types/config.d.ts.map +1 -0
- package/dist/src/types/detection.d.ts +114 -0
- package/dist/src/types/detection.d.ts.map +1 -0
- package/dist/src/types/events.d.ts +174 -0
- package/dist/src/types/events.d.ts.map +1 -0
- package/dist/src/types/fingerprint.d.ts +157 -0
- package/dist/src/types/fingerprint.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +83 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/methods.d.ts +83 -0
- package/dist/src/types/methods.d.ts.map +1 -0
- package/dist/src/types/visitor.d.ts +90 -0
- package/dist/src/types/visitor.d.ts.map +1 -0
- package/dist/src/utils/browser.d.ts +79 -0
- package/dist/src/utils/browser.d.ts.map +1 -0
- package/dist/src/utils/lazy-loader.d.ts +60 -0
- package/dist/src/utils/lazy-loader.d.ts.map +1 -0
- package/dist/src/utils/webgl-cache.d.ts +43 -0
- package/dist/src/utils/webgl-cache.d.ts.map +1 -0
- package/package.json +82 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Zaplier Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# @zaplier/sdk
|
|
2
|
+
|
|
3
|
+
**Advanced privacy-first tracking SDK with session replay, heatmaps, and anti-adblock technology.**
|
|
4
|
+
|
|
5
|
+
Makes a website visitor identifier from a browser fingerprint with enhanced session recording capabilities.
|
|
6
|
+
Unlike cookies and local storage, fingerprint stays the same in incognito/private mode and even when browser data is purged.
|
|
7
|
+
100% cookieless analytics tracking with GDPR/LGPD compliance, advanced bot detection, session replay, and heatmaps.
|
|
8
|
+
|
|
9
|
+
## ✨ Features
|
|
10
|
+
|
|
11
|
+
- 🛡️ **Privacy-First**: 100% cookieless tracking using advanced fingerprinting
|
|
12
|
+
- 🎬 **Session Replay**: Record and replay user sessions with DOM mutation tracking
|
|
13
|
+
- 🔥 **Heatmaps**: Track clicks, scrolls, and user interactions
|
|
14
|
+
- 🚫 **Anti-Adblock**: Multiple transport methods to bypass adblockers
|
|
15
|
+
- 🤖 **Bot Detection**: Advanced bot and fraud detection
|
|
16
|
+
- 🌍 **GDPR Compliant**: Built-in GDPR mode and consent management
|
|
17
|
+
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
Get a workspace token:
|
|
21
|
+
|
|
22
|
+
1. Register a new account at [zaplier.com/signup](https://zaplier.com/signup)
|
|
23
|
+
2. After registration go to the [dashboard](https://zaplier.com/workspaces) and create a new workspace
|
|
24
|
+
3. Go to the "API Keys" page, create and copy your workspace token
|
|
25
|
+
|
|
26
|
+
### Install from NPM
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm i @zaplier/sdk
|
|
30
|
+
# or
|
|
31
|
+
yarn add @zaplier/sdk
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
import { Zaplier } from "@zaplier/sdk";
|
|
36
|
+
|
|
37
|
+
// Initialize the SDK
|
|
38
|
+
const zaplier = Zaplier.init({
|
|
39
|
+
token: "your-workspace-token",
|
|
40
|
+
heatmap: true,
|
|
41
|
+
replay: true,
|
|
42
|
+
debug: true, // Enable for development
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// Track page views (automatic)
|
|
46
|
+
// Page views are tracked automatically
|
|
47
|
+
|
|
48
|
+
// Track conversions
|
|
49
|
+
zaplier.trackPurchase({
|
|
50
|
+
value: 99.99,
|
|
51
|
+
currency: "USD",
|
|
52
|
+
items: [{ id: "product-123", name: "Product Name" }]
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// Track custom events
|
|
56
|
+
zaplier.track("button_click", {
|
|
57
|
+
button_id: "signup",
|
|
58
|
+
page: "homepage",
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// Identify users
|
|
62
|
+
zaplier.identify({
|
|
63
|
+
email: "user@example.com",
|
|
64
|
+
name: "John Doe"
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// Get visitor data
|
|
68
|
+
console.log("Visitor ID:", zaplier.getVisitorId());
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Alternatively you can install from CDN
|
|
72
|
+
|
|
73
|
+
```html
|
|
74
|
+
<script src="https://cdn.jsdelivr.net/npm/@zaplier/sdk@1/dist/sdk.min.js"
|
|
75
|
+
data-token="your-workspace-token"
|
|
76
|
+
data-heatmap="true"
|
|
77
|
+
data-replay="true"></script>
|
|
78
|
+
<script>
|
|
79
|
+
// SDK is automatically initialized from data attributes
|
|
80
|
+
|
|
81
|
+
// Track custom events
|
|
82
|
+
Zaplier.track("page_interaction", {
|
|
83
|
+
element: "header_button",
|
|
84
|
+
action: "click",
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// Track conversions
|
|
88
|
+
Zaplier.trackPurchase({
|
|
89
|
+
value: 99.99,
|
|
90
|
+
currency: "USD",
|
|
91
|
+
items: [{ id: "product-123", name: "Product Name" }]
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// Get visitor identifier
|
|
95
|
+
console.log("Visitor ID:", Zaplier.getVisitorId());
|
|
96
|
+
</script>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Configuration Options
|
|
100
|
+
|
|
101
|
+
```js
|
|
102
|
+
Zaplier.init({
|
|
103
|
+
token: 'your-workspace-token', // Required: Your workspace token
|
|
104
|
+
heatmap: true, // Enable heatmap tracking
|
|
105
|
+
replay: true, // Enable session replay
|
|
106
|
+
debug: false, // Enable debug mode
|
|
107
|
+
gdprMode: false, // Enable GDPR compliance mode
|
|
108
|
+
allow_localhost: false // Allow tracking on localhost
|
|
109
|
+
});
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## API Reference
|
|
113
|
+
|
|
114
|
+
### Core Methods
|
|
115
|
+
|
|
116
|
+
- `Zaplier.init(config)` - Initialize the SDK
|
|
117
|
+
- `Zaplier.track(eventType, data?)` - Track custom events
|
|
118
|
+
- `Zaplier.trackPageView(data?)` - Track page views
|
|
119
|
+
- `Zaplier.trackConversion(type, value?, currency?, metadata?)` - Track conversions
|
|
120
|
+
- `Zaplier.identify(userData)` - Identify users
|
|
121
|
+
- `Zaplier.getVisitorId()` - Get current visitor ID
|
|
122
|
+
|
|
123
|
+
### Heatmap Controls
|
|
124
|
+
|
|
125
|
+
- `Zaplier.heatmap.enable()` - Enable heatmap tracking
|
|
126
|
+
- `Zaplier.heatmap.disable()` - Disable heatmap tracking
|
|
127
|
+
- `Zaplier.heatmap.isRecording()` - Check if recording
|
|
128
|
+
|
|
129
|
+
### Session Replay Controls
|
|
130
|
+
|
|
131
|
+
- `Zaplier.replay.start()` - Start session recording
|
|
132
|
+
- `Zaplier.replay.stop()` - Stop session recording
|
|
133
|
+
- `Zaplier.replay.isRecording()` - Check if recording
|
|
134
|
+
|
|
135
|
+
## Anti-Adblock Technology
|
|
136
|
+
|
|
137
|
+
The SDK automatically uses multiple transport methods to ensure data delivery:
|
|
138
|
+
|
|
139
|
+
1. **Standard Fetch** - Primary method
|
|
140
|
+
2. **WebSocket** - Real-time fallback
|
|
141
|
+
3. **Resource Spoofing** - Disguised as CSS/images/fonts
|
|
142
|
+
4. **WebRTC** - P2P data channel (experimental)
|
|
143
|
+
|
|
144
|
+
Note that you need to replace `your-workspace-token` with a workspace token from the [dashboard](https://zaplier.com/workspaces).
|