Ultra-lightweight, typed cookieless edge telemetry client, React component, and reverse-proxy recipes for DigiWebscape Private Insights Telemetry™.
- 100% Cookieless & Zero-Storage: Zero tracking cookies, zero
localStoragewrites, and zero persistent browser fingerprinting. - Stateless Edge Telemetry: Evaluated against EU ePrivacy Directive Article 5(3) & GDPR Article 11(2) audience measurement exemption architecture.
- React & Next.js Ready: Dedicated
<InsightsProvider />supporting Next.js App Router, Pages Router, and modern React SPAs. - Custom Conversion Events: Strongly typed
trackEvent()utility for tracking business conversions and milestone events. - First-Party Reverse-Proxy Recipes: Standardized configurations for Node.js, static site generators, and edge middleware to bypass ad-blocker false positives.
# npm
npm install @digiwebscape/beacon
# pnpm
pnpm add @digiwebscape/beacon
# yarn
yarn add @digiwebscape/beaconMount <InsightsProvider /> inside your root layout:
// app/layout.tsx
import { InsightsProvider } from '@digiwebscape/beacon/react';
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>
<InsightsProvider domain="yourdomain.com" />
{children}
</body>
</html>
);
}import { initTelemetry, trackEvent } from '@digiwebscape/beacon';
// Initialize the telemetry beacon
initTelemetry({
domain: 'yourdomain.com',
excludePaths: ['/admin', '/internal']
});
// Dispatch a custom conversion event
trackEvent('signup_completed', { plan: 'enterprise' });If you do not use a bundler or framework, simply embed the script tag directly:
<script defer data-domain="yourdomain.com" src="https://collect.digiwebscape.com/insights.js"></script>Ad blockers and aggressive browser extensions occasionally block third-party analytics scripts by default. You can route telemetry through your own domain using a first-party reverse proxy.
Route the script and telemetry events through your own origin:
// next.config.js
module.exports = {
async rewrites() {
return [
{
source: '/stats/script.js',
destination: 'https://collect.digiwebscape.com/insights.js'
},
{
source: '/stats/event',
destination: 'https://collect.digiwebscape.com/v1/events/collect'
}
];
}
};Then configure the beacon client:
<InsightsProvider
domain="yourdomain.com"
scriptSrc="/stats/script.js"
apiEndpoint="/stats/event"
/>Configure your edge server or reverse proxy to forward traffic:
- Path 1:
/stats/script.js➔https://collect.digiwebscape.com/insights.js - Path 2:
/stats/event➔https://collect.digiwebscape.com/v1/events/collect
When proxying POST requests to /stats/event, pass through the incoming client headers (User-Agent, Referer, and client IP headers) so the edge pipeline can calculate geo-distribution and referrer metadata accurately.
| Option | Type | Default | Description |
|---|---|---|---|
domain |
string |
(required) | Registered domain name for event attribution. |
apiEndpoint |
string |
https://collect.digiwebscape.com/v1/events/collect |
Custom event collection endpoint URL. |
scriptSrc |
string |
https://collect.digiwebscape.com/insights.js |
Custom script source path. |
consentRequired |
boolean |
false |
When true, delays tracking until optIn() is called. |
excludePaths |
string[] |
[] |
Path prefixes to exclude from pageview tracking. |
allowLocalhost |
boolean |
false |
Enable tracking during local testing. |
Dispatches a custom event with optional metadata attributes.
Toggles client-side telemetry preferences in transient window memory.
- Strictly zero vendor lock-in or third-party ad network tracking.
- Client tracker remains fully decoupled from backend server hashing mechanics.
- Raw IP addresses are processed in transient edge memory and discarded immediately (zero raw IP disk persistence).
Apache-2.0 License. Copyright © 2026 Hitender Sharma (DigiWebscape). All rights reserved. Part of the DigiWebscape™ platform.