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

@dxv-systems/conversions

v0.1.1

Published

DXV AI Marketing conversion tracking SDK — click-ID capture and signed conversion event emission

Readme

@dxv-systems/conversions

DXV AI Marketing conversion tracking SDK. Captures click IDs (gclid, fbclid, utm_*) on landing and emits signed server-side conversion events to the Marketing Portal's relay endpoint.

Install

npm install @dxv-systems/conversions

Onboarding

The DXV AI Marketing operator creates a customer in the Portal and provisions you with three values:

  • customerId — integer, identifies your customer record in the Portal
  • relaySecret — HMAC signing key (treat as a credential)
  • relayUrl — Portal endpoint base, typically https://marketing.dxvagentic.com

Store these as environment variables in your webshop's deployment.

Client side: capture click IDs on landing

In your landing-page handler (Next.js middleware, Express handler, anywhere):

import { captureClickIds, parseClickIdsCookie, serializeClickIdsCookie } from "@dxv-systems/conversions/client";

// On every request to a public page:
const url = new URL(request.url);
const captured = captureClickIds(url.searchParams);

if (captured) {
  // First-touch wins: don't overwrite an existing valid cookie.
  const existing = parseClickIdsCookie(request.cookies.get("dxv_click_ids")?.value);
  if (!existing) {
    response.cookies.set("dxv_click_ids", serializeClickIdsCookie(captured), {
      maxAge: 30 * 24 * 60 * 60, // 30 days
      httpOnly: false,           // intentionally readable from client (analytics)
      sameSite: "lax",
      secure: true,
    });
  }
}

Server side: emit purchase event

In your order-completed handler (Stripe webhook, etc.):

import { emitPurchase } from "@dxv-systems/conversions/server";
import { parseClickIdsCookie } from "@dxv-systems/conversions/client";

await emitPurchase({
  customerId: Number(process.env.DXV_CUSTOMER_ID),
  relaySecret: process.env.DXV_CONVERSIONS_RELAY_SECRET!,
  relayUrl: process.env.DXV_CONVERSIONS_RELAY_URL!,
  order: {
    id: order.id,
    totalCents: order.totalCents,
    currency: "EUR",
  },
  clickIds: parseClickIdsCookie(cookies.get("dxv_click_ids")),
  customer: {
    email: order.customer.email,    // plaintext; package hashes per Meta CAPI spec
    phone: order.customer.phone,
  },
});

emitPurchase retries 3 times on 5xx with exponential backoff. It throws typed errors:

  • InvalidConfig — missing/empty relaySecret, relayUrl, or customerId. Thrown synchronously before any network call.
  • RelayBadRequest — Portal returned 4xx (likely a stale relaySecret or wrong customerId). Not retried.
  • RelayUnavailable — Portal unreachable after 3 attempts.

Conventions

  • Money in cents (integer). The Portal validates totalCents > 0.
  • Currency as ISO 4217 (e.g. EUR, USD).
  • PII (email, phone) is hashed in-memory before the network call and never persisted by the Portal.
  • Click-ID cookie is first-touch wins for 30 days — do not overwrite if a valid cookie already exists.

License

MIT