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

@loopstack/react

v1.0.1

Published

React adapter for the Loopstack SDK — provider, TanStack Query hooks, and live stream bindings

Readme

@loopstack/react

React hooks for Loopstack — a thin TanStack Query adapter over @loopstack/client. Your app owns the QueryClient; this package contributes typed query and mutation hooks plus live cache invalidation from the backend's event stream.

npm install @loopstack/react @loopstack/client @tanstack/react-query

Setup

import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { createClient } from '@loopstack/client';
import { LoopstackProvider, useLiveInvalidation } from '@loopstack/react';

const queryClient = new QueryClient();
const client = createClient({ url: 'http://localhost:3000' });

function Live({ children }) {
  useLiveInvalidation(); // SSE events → targeted query invalidation
  return children;
}

export function App() {
  return (
    <QueryClientProvider client={queryClient}>
      <LoopstackProvider client={client}>
        <Live>
          <RunList />
        </Live>
      </LoopstackProvider>
    </QueryClientProvider>
  );
}
import { useStartWorkflow, useWorkflowList } from '@loopstack/react';

function RunList() {
  const { data } = useWorkflowList({ limit: 10 });
  const start = useStartWorkflow();

  return (
    <>
      <button onClick={() => start.mutate({ workflowName: 'hello', workspaceId: '…', args: { name: 'React' } })}>
        Run hello
      </button>
      <ul>
        {data?.data.map((run) => (
          <li key={run.id}>
            {run.workflowName} — {run.status}
          </li>
        ))}
      </ul>
    </>
  );
}

With useLiveInvalidation mounted, the list refreshes itself as runs progress — no polling.

Hooks

Queries (all support TanStack options incl. select, enabled): useWorkflow, useWorkflowStatus, useWorkflowList, useChildWorkflows, useWorkflowCheckpoints, useDocument, useWorkflowDocuments, useWorkspace, useWorkspaceList, useAppsConfig, useWorkflowConfig, useWorkflowSource, useToolConfigs, useToolConfig, useAvailableEnvironments, useDashboardStats, useMe, useWorkerHealth

Mutations (invalidate or update the relevant caches on success): useStartWorkflow, useRunWorkflow, useCreateWorkflow, useUpdateWorkflow, useDeleteWorkflow, useCreateWorkspace, useUpdateWorkspace, useSetFavouriteWorkspace, useDeleteWorkspace, useBatchDeleteWorkspaces, useHubLogin, useRefreshSession, useLogout

Streaming: useLlmStream(workflowId) accumulates live LLM tokens for a run; useLoopstackClient() returns the raw client for anything else.

Multiple environments

Cache keys are scoped by the client's envKey, so several LoopstackProviders (different backends) can safely share one QueryClient.

Documentation

Full docs: loopstack.ai/docs · Reference: loopstack.ai/docs/reference/react