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

@engagex/react

v0.1.1

Published

React / Next.js wrapper for EngageX tracking. Loads engage.v1.js from your tracking host and gives you a typed <EngageProvider>, sendEngageEvent() and engageIdentify() with automatic SPA page-view tracking.

Readme

@engagex/react

React / Next.js wrapper for EngageX tracking. It loads engage.v1.js from your tracking host and gives you a typed <EngageProvider>, sendEngageEvent() and engageIdentify() — with automatic page-view tracking across SPA route changes.

Like @next/third-parties, this package does not bundle the tracker — it injects the script from your host, so it auto-updates, keeps endpoint auto-detection, and shares the anonymous _cdp_tid identity with your landing pages / embedded forms.

Install

npm add @engagex/react
# or: pnpm add @engagex/react

Next.js (App Router)

// app/layout.tsx
import { EngageProvider } from '@engagex/react'

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html>
      <body>
        <EngageProvider publicKey="pk_live_xxx" />
        {children}
      </body>
    </html>
  )
}

You only pass publicKey — the tracking host is baked in. page.viewed fires automatically on every route change, no useEffect needed.

Self-hosting or local dev? Override the host: <EngageProvider publicKey="pk_..." host="http://localhost:8010" />.

Send events / identify (any client component)

'use client'
import { sendEngageEvent, engageIdentify } from '@engagex/react'

// business / behavioural event
sendEngageEvent('order.placed', { order_id: 'DH1', total: 1990000, currency: 'VND' })

// identify — resolving key (phone/email/zalo_id, ≥1) + optional traits + consent
engageIdentify(
  { phone: '0912345678', name: 'Nguyễn Văn An', gender: 'male', birthday: '1990-12-31' },
  { consent: true, purpose: 'marketing' },
)
  • Traits are applied fill-missing (never overwrite existing profile data).
  • Re-calling identify with the same phone updates, it does not create a duplicate. Identifying a different person rotates the anonymous id.

Plain React (Vite / CRA)

Same API. <EngageProvider> tracks route changes via the History API, so it works with React Router too — no extra wiring.

API

| Export | Description | | --- | --- | | <EngageProvider publicKey host autoPageview? branchId? /> | Loads the SDK + auto page-view. Mount once at the root. | | sendEngageEvent(event, properties?) | Forward a track call (SSR-safe). | | engageIdentify(identity, consent?) | Forward an identify call (SSR-safe). |

<EngageProvider> props

| Prop | Type | Default | | | --- | --- | --- | --- | | publicKey | string | — | Source public key (pk_...). | | host | string | (baked-in) | Tracking host serving engage.v1.js. Override only for self-hosting / local dev. | | autoPageview | boolean | true | Auto-fire page.viewed on route change. | | branchId | number \| string | — | Attached to every event. |

License

MIT