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

@nafann2026/cookie-manager

v1.1.5

Published

First-party e-commerce tracking SDK. Install and import once — sessions, product views, cart and purchases sync to your dashboard.

Readme

nafann-cookie-manager

Package npm de tracking first-party pour n’importe quelle boutique e-commerce.
Les autres l’installent, collent une ligne, et tes événements arrivent sur cookie-backend / le dashboard.

Compatible React, Next.js, Vite, Shopify (Hydrogen / thème via script), WooCommerce, Magento, sites custom.

Installation (ce que tes utilisateurs font)

npm install nafann-cookie-manager

React / Next / Vite — 1 ligne

Dans main.tsx, main.jsx ou app/layout.tsx :

import 'nafann-cookie-manager/auto';

Rien d’autre. Pas de Provider, pas d’appels track().

Script CDN (sans bundler, thème Shopify / HTML)

<script>
  window.NAFANN = {
    adminApiUrl: 'https://TON-COOKIE-BACKEND/api',
    siteName: 'Ma Boutique'
  };
</script>
<script src="https://unpkg.com/nafann-cookie-manager/dist/auto.iife.js"></script>

Config optionnelle

<meta name="nafann-api" content="https://TON-COOKIE-BACKEND/api" />

ou :

window.NAFANN = {
  adminApiUrl: 'https://TON-COOKIE-BACKEND/api',
  siteName: 'Ma Boutique',
  debug: false
};

Par défaut : https://marketingbackend.bingsepicerie.com/api.

Ce qui est tracké automatiquement

| Événement | Déclencheur | |-----------|-------------| | Session | chargement de la page | | Page vue | navigation (SPA comprise) | | Vue produit | URL /product/:id, /produit/:id ou data-product-id | | Durée de vue | temps passé sur la fiche (dashboard live) | | Ajout panier | bouton « Ajouter », formulaires Woo, POST /cart | | Achat | POST /order, /checkout, /payment |

Pour un tracking plus fiable, ajoute sur tes cartes :

<article data-product-id="123" data-product-name="Riz 5kg" data-product-price="4500">
  <button>Ajouter au panier</button>
</article>

API manuelle (facultatif)

import { useEcommerceTracking, useTracker, TrackerEvents } from 'nafann-cookie-manager';

const { trackProductView, trackAddToCart, trackPurchase } = useEcommerceTracking();
const { identify, setConsent } = useTracker();

identify(user.id, { email: user.email, firstName: user.firstName });
setConsent({ analytics: true, marketing: false });
trackPurchase({ orderId: 'ORD-1', items: [{ id: '123', name: 'Riz', price: 4500, quantity: 1 }] });

Pricing dynamique, panier abandonné avancé et notifications : enveloppe l’app avec AutoCookieManagerProvider (voir les exports du package).

Publier ce package (mainteneur)

npm run build
npm publish --access public

Le fichier dist/auto.iife.js est autonome (tracker inclus).
import 'nafann-cookie-manager/auto' est un bundle ESM autonome.

Licence

MIT