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

attribution-kit

v1.0.7

Published

Multi-touch marketing attribution for Vue and Nuxt

Readme

attribution-kit

Multi-touch marketing attribution for Vue 3 and Nuxt.

Track where every visitor came from — UTM parameters, referrer, or direct — and attach a full touch history to your API requests. Works as a framework-agnostic core, a Vue composable, or a zero-config Nuxt module.

Features

  • 🎯 Multi-touch tracking — records every source a visitor arrives from, not just the first or last.
  • 🔗 UTM + referrer resolution — falls back from UTM → referrer → "Direct" automatically.
  • 💾 Persistent — stores touches in localStorage with a configurable expiry (default 30 days).
  • 🧹 Deduplicated — the same source on the same day isn't recorded twice.
  • 📦 Three entry points — pure core, Vue composable, Nuxt module. Use what you need.
  • 🟦 Fully typed — written in TypeScript, ships with declarations.

Installation

npm install attribution-kit

vue and nuxt are optional peer dependencies — install only what your project uses.

Usage

Vue 3

import { useTracking } from 'attribution-kit/vue'

const { tracking, getPayload } = useTracking({ ttlDays: 30 })

// `tracking` is reactive — read first/last source, touch history, etc.
console.log(tracking.value)

// attach attribution to outgoing requests (e.g. in an axios interceptor)
axios.interceptors.request.use((config) => {
  if (['post', 'put', 'patch'].includes(config.method ?? '')) {
    config.data = { ...config.data, ...getPayload() }
  }
  return config
})

Optionally register the plugin to share options app-wide:

import { createApp } from 'vue'
import Attribution from 'attribution-kit/vue'

createApp(App).use(Attribution, { ttlDays: 30 }).mount('#app')

Nuxt

Add the module to nuxt.config.ts:

export default defineNuxtConfig({
  modules: ['attribution-kit/nuxt'],

  attribution: {
    ttlDays: 30,
  },
})

That's it. Tracking initializes automatically on first load, and useTracking() is auto-imported everywhere — no manual import needed:

<script setup lang="ts">
const { tracking, getPayload } = useTracking()
</script>

Framework-agnostic core

For any other environment (vanilla JS, a Node script, another framework):

import { createTracker } from 'attribution-kit'

const tracker = createTracker({ ttlDays: 30 })
tracker.init()

const payload = tracker.getPayload()

Configuration

| Option | Type | Default | Description | | ------------ | -------- | ------------------------ | -------------------------------------------- | | ttlDays | number | 30 | How long touches are kept before expiring. | | storageKey | string | "attribution_touches" | The localStorage key used to persist data. |

Payload shape

getPayload() returns an object ready to send with your API requests:

{
  "tracking": {
    "first_visit_time": "2026-01-01T10:00:00.000Z",
    "first_source": "Google Ads",
    "last_source": "WhatsApp",
    "touches_count": 3,
    "touches": [
      {
        "source": "Google Ads",
        "utm_source": "google",
        "utm_medium": "cpc",
        "utm_campaign": "winter-sale",
        "timestamp": "2026-01-01T10:00:00.000Z"
      }
    ]
  }
}

License

MIT © Kerolos Sadek