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

@sourcea/sdk

v0.4.0

Published

Sourcea browser SDK — lead attribution and conversion tracking.

Readme

@sourcea/sdk

Sourcea browser SDK: lead attribution and conversion tracking.

It records where each visitor came from (UTM parameters, click ids such as gclid and fbclid, the GA4 client id, referrer, landing page) and sends the enquiries they make (forms, taps on your phone number) to your Sourcea workspace, with that origin attached. About 3 KB gzipped, no cookies.

Documentation: https://analytics.sourcea.io/en/docs/sdk (in French: https://analytics.sourcea.io/fr/docs/sdk)

Install

npm install @sourcea/sdk

Or with a script tag, pinned to a version:

<script src="https://cdn.jsdelivr.net/npm/@sourcea/[email protected]/dist/browser/sourcea.min.js"></script>

Usage

Create a key in the dashboard under Settings → API keys (sa_live_…). The key is public: it can only write into your workspace.

import { createSourcea } from '@sourcea/sdk';

const sourcea = createSourcea({ apiKey: 'sa_live_...' });

// On every page, after consent in the EU: where the visitor came from.
// The tab keeps one session; a page with its own utm_*/gclid starts a new one.
void sourcea.trackSession();
sourcea.trackPageView();

// No consent needed: a lead for every tap on a tel: link.
sourcea.trackPhoneClicks();

// A form.
const result = await sourcea.sendLead(
  { email: '[email protected]', message: 'Quote for a roof' },
  { kind: 'quote_request' },
);
if (!result.ok) console.warn(result.error);

Without consent to tracking, send the lead without attribution identifiers: sendLead(contact, { kind: 'contact', attribution: false }).

With the script tag, window.Sourcea is a ready-made client (Sourcea.init({ apiKey })) and window.SourceaSDK holds every other export.

API

| Export | Purpose | | --- | --- | | createSourcea(config) | Creates and initialises a SourceaClient. | | client.init(config) | { apiKey, apiUrl?, debug?, testMode? }. testMode: true stores everything the SDK sends as test data (not counted, never sent to ad platforms, notification mails marked "Test"); off by default. | | client.trackSession() | Opens the tab's session with the page's attribution, or keeps the current one. Stores an identifier. | | client.trackPageView(path?, title?) | Adds a page to the journey attached to the next lead. | | client.track(type, metadata?) | Records an event of EVENT_TYPES on the session. | | client.sendLead(contact, opts?) | Sends a lead; resolves to a SendLeadResult. | | client.trackPhoneClicks(opts?) | A lead per tap on a tel: link; returns stop(). | | captureAttribution(visitorId) | Reads the page's attribution. | | getVisitorId(), getSessionId(), setSessionId() | Storage helpers. | | readConsent(), writeConsent(), forgetTracking() | Consent helpers. | | SDK_VERSION | The SDK's version. |

Every option, default and error code is in the API reference. Changes: CHANGELOG.md.

License

MIT