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

@taskip/analytics

v1.4.0

Published

Analytics SDK for Taskip — cross-domain attribution, event tracking, and marketing channel intelligence

Readme

@taskip/analytics

Client-side analytics SDK for Taskip — cross-domain attribution, event tracking, and marketing channel intelligence.

Installation

npm install @taskip/analytics

Setup

import { TaskipAnalytics } from '@taskip/analytics';

const analytics = new TaskipAnalytics({
  endpoint: 'https://analytics.taskip.net',
  writeKey: 'wi_...',
  debug: true,
});

Getting your credentials

Create an API app in the Developer Settings → API Keys page of the Taskip Analytics dashboard. Each app gets a unique write key. Use that write key here.

Options

| Option | Default | Description | |--------|---------|-------------| | endpoint | — | Analytics API URL | | writeKey | — | Write key from Developer Settings → API Keys | | enabled | true | Enable/disable all tracking | | flushThreshold | 10 | Flush after this many queued events | | flushInterval | 30000 | Flush interval in ms | | cookieDomain | '.taskip.net' | Domain for cross-subdomain attribution cookies | | debug | false | Log events to console | | affonso.accountId | — | Affonso affiliate tracking account ID |


Core API

track(event, properties?)

Send a custom event.

analytics.track('invoice_sent', {
  invoiceId: 'inv_123',
  amount: 1200,
});

page(options)

Track a page view. Auto-attaches referrer and title.

analytics.page({ name: 'Pricing', path: '/pricing' });

identify(traits)

Attach user/workspace identity. Persisted in cookies + localStorage.

analytics.identify({
  userId: 'usr_abc',
  email: '[email protected]',
  workspace: 'tn-perchco',
  plan: 'Pro',
});

signupSource is auto-populated from the last page visited before identify() was called.

getAttribution()

Get current attribution data (UTMs, referrer, AI source, etc.).

const attr = analytics.getAttribution();

captureAttribution()

Re-capture attribution from current URL. Call after client-side navigation.

analytics.captureAttribution();

getIdentity()

Get current identity data.

flush()

Force-send all queued events immediately.

destroy()

Flush remaining events and clear the flush timer.


Free Tools & Templates

Convenience methods for tracking free tool and template interactions.

analytics.freeToolViewed('Invoice Generator');
analytics.freeToolUsed('Invoice Generator', 'download');

analytics.templateViewed('Invoice Template');
analytics.templateUsed('Invoice Template', 'copy');

These fire free_tool_viewed, free_tool_used, template_viewed, template_used events.


Attribution

SDK captures these on initialization and every captureAttribution() call:

| Signal | Source | Example | |--------|--------|---------| | UTM params | URL query | ?utm_source=google&utm_medium=cpc | | Google Ads | URL + cookie | gclid, wbraid, gbraid | | Meta/Facebook | Cookie | fbp, fbc | | TikTok | URL + session | ttclid | | Content referral | URL query | ?rel=blog, ?rel=docs | | Affiliate | URL query | ?via=ref123, ?aff=ref123 | | Referrer | document.referrer | https://google.com | | AI source | Referrer domain | ChatGPT, Claude, Perplexity, Gemini, Copilot, DeepSeek, Mistral, Grok | | Landing page | First page in session | Preserved in cookie | | Last seen page | Updated on every capture | Used as signupSource on identify |


React

usePageView(analytics)

Auto-tracks page views on route changes. Works with Next.js App Router and any React Router.

import { useMemo } from 'react';
import { TaskipAnalytics, usePageView } from '@taskip/analytics/react';

function App() {
  const analytics = useMemo(() => new TaskipAnalytics({
    endpoint: 'https://analytics.taskip.net',
    writeKey: 'wk_...',
  }), []);

  usePageView(analytics);

  return <Routes>...</Routes>;
}

Affiliate Tracking (Affonso)

const analytics = new TaskipAnalytics({
  endpoint: 'https://analytics.taskip.net',
  writeKey: 'wk_...',
  affonso: {
    accountId: 'acc_123',
  },
});

// On signup/conversion:
analytics.affonsoSignup('[email protected]');

// On checkout — attach to Stripe:
analytics.getAffiliateMetadata();
// → { affonso_referral: 'ref123', affiliate_id: 'ref123', ... }

Performance

  • Events queue in memory and flush every 30s (or when 10 events accumulate)
  • Uses navigator.sendBeacon for reliable delivery on page unload
  • No blocking calls on the main thread
  • Failed events are re-queued for the next flush cycle

TypeScript

import type {
  AnalyticsConfig,
  AnalyticsEvent,
  EventContext,
  AttributionData,
  UserIdentity,
  PageViewOptions,
} from '@taskip/analytics';