npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@clocsy/track

v1.1.0

Published

Clocsy website activity SDK: page views and named events with consent controls.

Readme

@clocsy/track 1.1.0 (prepared release)

Website page and named-event analytics for Clocsy. This repository version uses the same v1.1 protocol as the installation script. Publication of this version and verification of the registry artifact are separate release steps; do not assume the public registry already contains it.

Setup

Use your project ID and public tracking token from My Business → Website tracking. Save the correct HTTPS website in My Business. The token identifies the site; it is not a secret.

import { init, track, setConsent } from '@clocsy/track';

init({ projectId: 'YOUR_PROJECT_ID', token: 'YOUR_TOKEN', consent: false });
// After your own site's consent flow permits analytics:
setConsent(true);
// At a completed action:
track('signup_complete');

For a bundled installation, put the dashboard's verification tag in server-rendered HTML:

<meta name="clocsy-verification" content="YOUR_TOKEN">

Alternatively add the dashboard's DNS TXT record and select Check DNS record. Initial beacons cannot certify ownership by presenting a token alone. The API checks the saved website for the challenge or verifies DNS. HTTP page verification is bounded to public IPv4 HTTPS destinations on the configured host (including its www variant), with a DNS TXT alternative for other installations.

The standalone sdk.js script is also available from the dashboard. Use only one installation method on a page. Script usage is window.clocsy.track('signup_complete'), an object method, not a callable command queue.

Behavior

  • Initial page view, history push/replace and popstate navigation are supported.
  • pageview() records a manual page view.
  • setConsent(false) stops recording and discards pending unsent events. No cookies or persistent visitor identifiers are created. Global Privacy Control or Do Not Track disables collection.
  • Browser URL queries/fragments, page titles and referrer paths are omitted. Only named UTM campaign fields are retained; obvious sensitive values and paths are redacted. Avoid personal data in site paths, campaign values and event names.
  • Custom events store a short name and timestamp. Legacy metadata arguments are ignored. identify() is deprecated and sends nothing.
  • Events are untrusted analytics, not verified sales revenue, user identities, confirmed business facts, payout requests or instructions to the Sales engine.
  • Page/event samples are capped at 100/50. The dashboard shows the last seven days; stale samples are removed on subsequent ingestion. Aggregate lifetime counts remain. Retry IDs are retained for up to seven days, bounded to the newest 1,000 accepted IDs; this is a bounded duplicate-suppression window, not an indefinite event ledger.
  • The server limits project activity to 600 accepted events/minute in addition to IP limits. It serializes writes per project so simultaneous page/custom events cannot overwrite one another.
  • Up to 20 events wait in memory for installation verification. Failed verification sends no activity; another page view/event can retry verification. Reloading clears this in-memory buffer.
  • No paid AI, mail, enrichment or conversion payout is triggered by analytics.

Protocol

Default API host: https://clocsy.com. apiBase overrides the origin for controlled environments.

| Operation | Endpoint | Core fields | |---|---|---| | Installation check | POST /api/sdk/ping | pid, tok, sanitized url | | Page view | POST /api/sdk/page | Above plus eventId, sanitized page/campaign/referrer fields | | Named event | POST /api/sdk/event | Above plus eventId, event |

Requests omit credentials/cookies. The browser origin and URL must match the configured website. Origin validation mitigates unrelated browser installations; a public browser token is not a cryptographic signature against a server forging requests.

Legacy /verify, /pageview, /track route aliases and projectId/token aliases are accepted by the API, but current clients send the canonical names. Personal identity requests return unsupported.

Verification

Run the repository SDK route, client-contract and proof tests, and build this package. Before publication/deployment acceptance, verify the built artifact on a controlled HTTPS site, including initial page, SPA navigation, custom events, consent, reload and dashboard refresh. Verify the published package tarball independently after publication.