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

@traque/react

v0.0.1-beta.1

Published

React SDK for error tracking and monitoring. This package provides React-specific components and hooks for integrating with the Traque error tracking service.

Readme

@traque/react

React SDK for error tracking and monitoring. This package provides React-specific components and hooks for integrating with the Traque error tracking service.

Installation

npm install @traque/react
# or
yarn add @traque/react
# or
pnpm install @traque/react

Quick Start

Initialize the Traque client and wrap your app with the TraqueProvider:

import { Traque } from '@traque/core';
import { TraqueProvider } from '@traque/react';

// Initialize the Traque client
const traque = new Traque({
  serviceUrl: 'https://your-service-url.com',
  apiKey: 'your-api-key',
  environment: 'PRODUCTION',
});

function App() {
  return (
    <TraqueProvider traque={traque}>
      <YourApp />
    </TraqueProvider>
  );
}

Error Boundary

Use the ErrorBoundary component to catch and report React errors:

import { ErrorBoundary } from '@traque/react';

function MyComponent() {
  return (
    <ErrorBoundary
      fallback={(error) => (
        <div>
          <h1>Something went wrong</h1>
          <p>{error.message}</p>
        </div>
      )}
      onError={(error, errorInfo) => {
        console.log('Error caught:', error);
        console.log('Component stack:', errorInfo.componentStack);
      }}
    >
      <YourComponent />
    </ErrorBoundary>
  );
}

Manual Error Reporting

Use the useTraque hook to manually report errors:

import { useTraque } from '@traque/react';

function MyComponent() {
  const { captureException } = useTraque();

  const handleClick = async () => {
    try {
      // Your code that might throw
      await someAsyncOperation();
    } catch (error) {
      captureException({
        name: error.name,
        message: error.message,
        // Add any additional context
        httpContext: {
          url: window.location.href,
          method: 'GET',
        },
      });
    }
  };

  return <button onClick={handleClick}>Do Something</button>;
}

API Reference

TraqueProvider

The provider component that provides the Traque instance to your app.

<TraqueProvider traque={Traque}>{children}</TraqueProvider>

ErrorBoundary

A React error boundary component that catches and reports errors.

<ErrorBoundary
  fallback?: ReactNode | ((error: Error) => ReactNode)
  onError?: (error: Error, errorInfo: ErrorInfo) => void
>
  {children}
</ErrorBoundary>

useTraque

A hook that provides access to the Traque instance and error reporting functions.

const { traque, captureException } = useTraque();

TypeScript Support

This package is fully typed and provides TypeScript definitions for all components and functions.