pagevalue
v0.1.0
Published
Client for the pagevalue analytics beacon — cookieless, transparent, blockable. Counts heads, not identities.
Downloads
154
Readme
pagevalue (client)
Tiny TypeScript client for the pagevalue analytics beacon — cookieless, transparent, blockable. Counts heads, not identities. Sets no cookie, no localStorage, no identifier of any kind.
Install
npm install pagevaluePublished as pagevalue on npm.
Zero dependencies; the React adapter is an optional entry point
(pagevalue/react, React is an optional peer).
Vanilla
import { pagevalue } from 'pagevalue';
const pv = pagevalue({ endpoint: '' }); // same-origin
// SPA? call pv.trackPageview(newPath) on navigation.Or skip the package entirely — it's one image URL and one sendBeacon; read
src/index.ts, it fits on a screen.
React
import { usePageValue } from 'pagevalue/react';
function App() {
const location = useLocation(); // your router
usePageValue(location.pathname);
return <Routes />;
}What it sends
Per pageview, as a plain GET /pixel.gif (visible in devtools, blockable by
name — on purpose): path, referrer, viewport width, language, and UTM params
if present. On pagehide, one sendBeacon to /hit with seconds-on-page.
Nothing else, ever. Identity handling (daily-salted, dies at midnight) is
server-side — see the server README.
Visitors with Global Privacy Control or DNT enabled are counted without any visitor hash at all, server-side.
License
Apache-2.0
