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

@traceitx/react

v0.6.3

Published

React SDK for TraceItX — AI-ready in-app bug reporting with screenshots, annotation, session replay, breadcrumbs, and crash capture.

Readme

@traceitx/react

React (web) SDK for TraceItX — AI-ready bug reporting embedded in your app.

Apache-2.0 · React 18 || 19 · ESM-only · Node 20+

Install

pnpm add @traceitx/react
# or
npm install @traceitx/react

Optional but recommended: install the displayName preservation plugin so component names survive minification:

# Babel users (Webpack / CRA / Next.js with Babel config)
pnpm add -D @traceitx/babel-plugin-displayname

# SWC users (Next.js default since 12+)
pnpm add -D @traceitx/swc-plugin-displayname

Quickstart

Wrap your app once. The Provider mounts the floating bubble, registers the hotkey, and owns the reporter modal lifecycle.

// app/layout.tsx (Next.js app router)
import { TraceItXProvider } from '@traceitx/react';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html>
      <body>
        <TraceItXProvider config={{ apiKey: 'txx_live_xxxxxxxxxxxxxxxx' }}>
          {children}
        </TraceItXProvider>
      </body>
    </html>
  );
}

Open the reporter programmatically from anywhere:

'use client';
import { useTraceItX } from '@traceitx/react';

export function HelpButton() {
  const { open } = useTraceItX();
  return <button onClick={open}>Report a bug</button>;
}

Triggers

By default the SDK installs:

  • Hotkey Cmd/Ctrl+Shift+B (TRIG-03) — rebind with config.hotkey = { binding: 'Mod+Shift+R' }, or disable with config.hotkey = false

Mod resolves to Cmd on macOS and Ctrl elsewhere.

A visible trigger (bubble, menu item, etc.) is the host app's responsibility — call useTraceItX().open() from your own button to bring up the reporter.

Strict-CSP environments

If your app sets a strict CSP (script-src 'self' 'nonce-...'), thread the nonce into the SDK so screenshot capture's dynamically-injected styles are accepted:

// Next.js: read the nonce from headers() in your layout
import { headers } from 'next/headers';

export default async function RootLayout({ children }: { children: React.ReactNode }) {
  const nonce = (await headers()).get('x-nonce') ?? '';
  return (
    <TraceItXProvider config={{ apiKey: 'txx_live_xxxxxxxxxxxxxxxx', cspNonce: nonce }}>
      {children}
    </TraceItXProvider>
  );
}

Marking sensitive content (PRIV-02)

Three equivalent surfaces — pick whichever fits your codebase:

import { Sensitive, useTraceItX } from '@traceitx/react';
import { useEffect, useRef } from 'react';

// 1. Component wrapper
<Sensitive><CreditCardNumber /></Sensitive>

// 2. data-attribute (works on any DOM element)
<div data-traceitx-sensitive>{value}</div>

// 3. Ref hook
function MyField({ value }: { value: string }) {
  const ref = useRef<HTMLDivElement>(null);
  const { markSensitive } = useTraceItX();
  useEffect(() => {
    if (ref.current) markSensitive(ref);
  }, [markSensitive]);
  return <div ref={ref}>{value}</div>;
}

All three resolve to the same internal sensitive-rect registry; pixels under those rects are blanked at capture time before the screenshot bytes leave the device.

Bundling notes

The SDK is ESM-only. Some Next.js + monorepo setups need to transpile workspace packages:

// next.config.ts
transpilePackages: ['@traceitx/react', '@traceitx/sdk-core', '@traceitx/protocol'],

The always-loaded entry measures ~136 KB gzip (pnpm size-limit, budget 240 KB). The heavy capture and annotation dependencies — rrweb, react-konva, bippy, modern-screenshot, html-to-image — are lazy-imported and are not in that number; they load only when the reporter is actually opened.

Example

See examples/react-web/ for a Next.js dogfood project covering both the strict-CSP fixture and the standard SSR fixture.