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

@reliableapp/react

v1.2.0

Published

React bindings for Reliable — Provider, ErrorBoundary with component stacks, hooks, and router adapters. Re-exports the full core SDK.

Readme

@reliableapp/react

npm version npm downloads bundle size types license

React bindings for Reliable. Wraps @reliableapp/frontend-core with a <ReliableProvider>, an error boundary that captures component stacks, hooks that get you the active client, and adapters for the two React Router setups.

You only need this package — the core SDK is re-exported, so a single install covers both surfaces.

Install

# pnpm
pnpm add @reliableapp/react

# npm
npm install @reliableapp/react

# yarn
yarn add @reliableapp/react

Peer dependency: React >= 18.

Quick start

Mount <ReliableProvider> at the root of your tree and wrap your app in <ReliableErrorBoundary>:

import {
    ReliableProvider,
    ReliableErrorBoundary,
} from '@reliableapp/react';

export default function App() {
    return (
        <ReliableProvider config={{ publicKey: 'pk_live_rl_xxxxxxxxxxxxxxxx' }}>
            <ReliableErrorBoundary fallback={<p>Something went wrong.</p>}>
                <YourApp />
            </ReliableErrorBoundary>
        </ReliableProvider>
    );
}

That's enough to capture errors, web vitals, network failures, interactions, session replays, WebSockets, and console output across the whole app. Every component-tree crash from ReliableErrorBoundary is reported with the React component stack alongside the JS stack.

Next.js

For the App Router, mount the provider inside app/layout.tsx:

// app/layout.tsx
'use client';

import { ReliableProvider } from '@reliableapp/react';

export default function RootLayout({ children }: { children: React.ReactNode }) {
    return (
        <html>
            <body>
                <ReliableProvider config={{
                    publicKey: process.env.NEXT_PUBLIC_RELIABLE_KEY!,
                    release:   process.env.NEXT_PUBLIC_GIT_SHA,
                }}>
                    {children}
                </ReliableProvider>
            </body>
        </html>
    );
}

For the Pages Router, mount in _app.tsx. See the full Next.js guide.

What's in the box

<ReliableProvider config={...}>

Initialises the SDK exactly once (idempotent through React StrictMode and HMR), exposes the client via context, and flushes the outbound queue on unmount so events aren't lost during hot reload.

Accepts the same ReliableConfig shape as init() from the core package — see the config reference.

<ReliableErrorBoundary fallback={...}>

A standard React error boundary that, on catch, forwards the error to Reliable along with the React componentStack. Pair with a key prop to reset on navigation:

<ReliableErrorBoundary
    fallback={({ error, reset }) => (
        <div>
            <h1>Something broke.</h1>
            <button onClick={reset}>Try again</button>
        </div>
    )}
>
    <Routes />
</ReliableErrorBoundary>

Hooks

import {
    useReliable,           // → the active ReliableClient
    useIdentify,           // → call identify on mount / on user change
    useCaptureException,   // → stable captureException reference
    useCaptureMessage,     // → stable captureMessage reference
    useAddBreadcrumb,      // → stable addBreadcrumb reference
    useSetTag,             // → stable setTag reference
    useSetTags,            // → stable setTags reference
    useFlush,              // → stable flush reference
} from '@reliableapp/react';

Example:

function Checkout() {
    const captureException = useCaptureException();

    const onSubmit = async () => {
        try {
            await placeOrder();
        } catch (err) {
            captureException(err, { severity: 'high', tags: { step: 'submit' } });
            throw err;
        }
    };

    // ...
}
function AuthSync({ user }: { user: User | null }) {
    useIdentify(user
        ? { externalId: user.id, email: user.email, name: user.name }
        : null);
    return null;
}

Router adapters

import {
    useReliableRouter,            // generic — call from any router on path change
    useReliableNextPagesRouter,   // Next.js Pages Router (next/router)
} from '@reliableapp/react';

The adapters push navigation breadcrumbs and update getCurrentPath() so subsequent errors / vitals / network events know which route they fired from. Mount once at the root of the routed subtree.

For the Next.js App Router or React Router v6, use useReliableRouter() with the relevant location hook:

// Next.js App Router
'use client';
import { usePathname } from 'next/navigation';
import { useReliableRouter } from '@reliableapp/react';

export function ReliableNavSync() {
    useReliableRouter(usePathname());
    return null;
}
// React Router v6
import { useLocation } from 'react-router-dom';
import { useReliableRouter } from '@reliableapp/react';

export function ReliableNavSync() {
    useReliableRouter(useLocation().pathname);
    return null;
}

Re-exported from core

Everything in @reliableapp/frontend-core is re-exported, so you don't need a second install:

import {
    init, getClient, identify, setTag, setTags,
    addBreadcrumb, flush, captureException, captureMessage,
    type ReliableConfig, type ReliableClient, type UserIdentity,
    type CaptureOptions, type CaptureMessageOptions,
} from '@reliableapp/react';

Contributing

Issues, discussions, and PRs welcome on the reliable-sdk repo. Releases are driven by Changesets — see the core README for the workflow.

License

Apache 2.0 © Ziloris