@rabbitracker/sdk
v3.2.4
Published
Advanced privacy-first tracking SDK with fingerprinting and security detection
Maintainers
Readme
Makes a website visitor identifier from a browser fingerprint. Unlike cookies and local storage, fingerprint stays the same in incognito/private mode and even when browser data is purged. 100% cookieless analytics tracking with GDPR/LGPD compliance and advanced bot detection.
Quick start
Get a workspace token:
- Register a new account at rabbitracker.com/signup
- After registration go to the dashboard and create a new workspace
- Go to the "API Keys" page, create and copy your workspace token
Install from NPM
npm i @rabbitracker/sdk
# or
yarn add @rabbitracker/sdkimport RabbitTrackerSDK from "@rabbitracker/sdk";
// Initialize an agent at application startup.
const tracker = new RabbitTrackerSDK({
token: "your-workspace-token",
debug: true, // Enable for development
});
// Track page views (automatic)
// tracker.trackPageView() is called automatically
// Track conversions
tracker.trackPurchase({
value: 99.99,
currency: "USD",
productId: "product-123",
});
// Track custom events
tracker.trackCustomEvent("button_click", {
button_id: "signup",
page: "homepage",
});
// Get visitor data
console.log("Visitor ID:", tracker.getUserData().fingerprint);Alternatively you can install from CDN
Note: Installing via a script tag may interfere with SDK functionality for users with ad blockers enabled.
<script src="https://cdn.jsdelivr.net/npm/@rabbitracker/sdk@3/dist/sdk.min.js"></script>
<script>
// Initialize the agent at application startup.
const tracker = new RabbitTracker({
token: "your-workspace-token",
});
// Track custom events
tracker.trackCustomEvent("page_interaction", {
element: "header_button",
action: "click",
});
// Get visitor identifier
const userData = tracker.getUserData();
console.log("Visitor ID:", userData.fingerprint);
</script>Note that you need to replace your-workspace-token with a workspace token from the dashboard.
