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

taronja-gateway-react-sdk

v0.0.24

Published

React and TypeScript SDK for Taronja Gateway

Downloads

13

Readme

taronja-gateway-react-sdk

Independent React and TypeScript SDK for Taronja Gateway.

This package is intended to move into the external clients repository later, but it lives in /sdk for now so the API can stabilize against the existing gateway and dashboard code.

Included now

  • A transport client for the gateway endpoints already used in the dashboard.
  • A React auth provider with session polling, login, logout, and role helpers.
  • Route guards and higher-order components for authenticated and admin-only UI.
  • User profile helpers such as display name, avatar, and initials.

Feature modules exposed by the client

  • Session and user profile: getCurrentUser, getLoginUrl, logout
  • Health and discovery: getHealth, getOpenApiYaml
  • User administration: listUsers, getUserById, createUser
  • Token management: listTokens, getToken, createToken, deleteToken
  • Request analytics: getRequestStatistics, getRequestDetails
  • Rate limiting: getRateLimiterStats, getRateLimiterConfig
  • Counters: getAvailableCounters, getAllUserCounters, getUserCounters, getUserCounterHistory, adjustUserCounters

Worth including next

  • Optional TanStack Query adapters so consumers can use the same hooks as the dashboard without rebuilding query keys.
  • React Router specific redirect helpers to remove direct window.location handling from consuming apps.
  • OAuth provider login helpers if gateway login flows expose provider-specific routes or query parameters.
  • Shared admin UI primitives for loading, unauthorized, and access-denied states when the package scope broadens beyond headless SDK behavior.

Install

npm install taronja-gateway-react-sdk react

For local work inside this repository:

cd sdk
npm install
npm run typecheck
npm run build

Published releases are automated from the main repository release tag. The release workflow publishes this package to npm and mirrors the source package into jmaister/taronja-gateway-clients.

Quick start

import {
    TaronjaAuthProvider,
    RequireAdmin,
    createTaronjaClient,
    useTaronjaAuth,
} from 'taronja-gateway-react-sdk';

const client = createTaronjaClient({
    baseUrl: '/_',
});

function ProfileSummary() {
    const { currentUser, isAuthenticated, logout } = useTaronjaAuth();

    if (!isAuthenticated || !currentUser) {
        return <button onClick={() => window.location.assign(client.getLoginUrl())}>Login</button>;
    }

    return (
        <div>
            <p>{currentUser.username}</p>
            <button onClick={() => void logout()}>Logout</button>
        </div>
    );
}

export function App() {
    return (
        <TaronjaAuthProvider client={client}>
            <RequireAdmin fallback={<p>Admin access required.</p>}>
                <ProfileSummary />
            </RequireAdmin>
        </TaronjaAuthProvider>
    );
}