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

@pura-ai/react

v0.1.1

Published

Official React components for the Pura LLM SDK

Readme

@pura-ai/react

Registry version · API 2026-10-01 · Proprietary license

Official Pura LLM React components, version 0.1.0. React 18.2/19 and @pura-ai/sdk 0.1.x are peer dependencies. ESM with declarations, no CSS framework required; unused exports can be tree-shaken. License: proprietary, LICENSE. See CHANGELOG.

npm install @pura-ai/sdk @pura-ai/react react

Registry publication status is tracked in the release guide. Before publication, build with pnpm --dir packages --filter @pura-ai/sdk build and pnpm --dir packages --filter @pura-ai/react build, then pnpm pack.

import {ConnectPuraLLM, UsagePanel} from '@pura-ai/react';
import {PuraInferenceClient, completeBrowserConnection, type StoredTokens} from '@pura-ai/sdk';

const options = {
  apiBase: 'https://ai.puradigital.it/v1',
  clientId: 'YOUR_REGISTERED_PUBLIC_CLIENT_ID',
  redirectUri: 'https://your-app.example/pura/callback',
};
// Minimal single-tab demo only: reconnect after reload. Use your application's
// per-user session adapter for production; never embed a client secret.
let tokens: StoredTokens | null = null;
const store = {get: async () => tokens, set: async (value: StoredTokens) => {tokens = value;}};
const client = new PuraInferenceClient({...options, store});

// On the registered callback page, in the same tab, before mounting UsagePanel:
// await store.set(await completeBrowserConnection(options));
export function Connect() {
  return <ConnectPuraLLM options={options} onError={console.error} />;
}
export function ConnectedUsage() {
  return <UsagePanel client={client} />;
}

ConnectPuraLLM renders a white button with the official logo and the exact text “Connect Pura LLM”. It delegates PKCE, state, storage and navigation to the SDK. It prevents double clicks and calls onError if authorization fails. Standard button props and style are supported; label and click behavior are fixed.

UsagePanel calls only client.usage(). Pass a stable client and change refreshKey after inference to reload. It renders loading, error and blocked states, monthly/weekly percentages and ISO reset dates. It suppresses stale responses when unmounted or when the client changes. No monetary budgets, token storage, OAuth refresh logic or wallet fallback are implemented in the UI.

A complete demo component is available in examples/App.tsx (included in the npm package). Mount it in your React application, replace client ID/callback with a registered public client, and serve both the initial page and callback over HTTPS. The demo handles callback exchange, chat and usage refresh. Its in-memory token store is for one browser session: reconnect after reload; adapt persistence to your app.