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

@fluxbase/sdk-react

v2026.3.5

Published

React hooks for Fluxbase SDK

Readme

@fluxbase/sdk-react

React hooks for Fluxbase - Backend as a Service.

npm version License: MIT

Features

  • React Hooks - Idiomatic React hooks for all Fluxbase features
  • TanStack Query - Built on React Query for optimal data fetching
  • Type-safe - Full TypeScript support
  • Auto-refetch - Smart cache invalidation and refetching
  • Optimistic Updates - Instant UI updates
  • SSR Support - Works with Next.js and other SSR frameworks

Installation

# npm
npm install @fluxbase/sdk @fluxbase/sdk-react @tanstack/react-query

# pnpm
pnpm add @fluxbase/sdk @fluxbase/sdk-react @tanstack/react-query

Quick Start

import { createClient } from "@fluxbase/sdk";
import { FluxbaseProvider, useAuth, useTable } from "@fluxbase/sdk-react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

// Create clients
const fluxbaseClient = createClient({ url: "http://localhost:8080" });
const queryClient = new QueryClient();

function App() {
  return (
    <QueryClientProvider client={queryClient}>
      <FluxbaseProvider client={fluxbaseClient}>
        <YourApp />
      </FluxbaseProvider>
    </QueryClientProvider>
  );
}

function YourApp() {
  const { user, signIn, signOut } = useAuth();
  const { data: products } = useTable("products", (q) =>
    q.select("*").eq("active", true).order("created_at", { ascending: false })
  );

  return (
    <div>
      {user ? (
        <>
          <p>Welcome {user.email}</p>
          <button onClick={signOut}>Sign Out</button>
        </>
      ) : (
        <button
          onClick={() =>
            signIn({ email: "[email protected]", password: "pass" })
          }
        >
          Sign In
        </button>
      )}

      <h2>Products</h2>
      {products?.map((product) => (
        <div key={product.id}>{product.name}</div>
      ))}
    </div>
  );
}

Available Hooks

Authentication

  • useAuth() - Complete auth state and methods
  • useUser() - Current user data
  • useSession() - Current session
  • useSignIn() - Sign in mutation
  • useSignUp() - Sign up mutation
  • useSignOut() - Sign out mutation
  • useUpdateUser() - Update user profile

Database

  • useTable() - Query table with filters and ordering
  • useFluxbaseQuery() - Custom query hook
  • useInsert() - Insert rows
  • useUpdate() - Update rows
  • useUpsert() - Insert or update
  • useDelete() - Delete rows
  • useFluxbaseMutation() - Generic mutation hook

Realtime

  • useRealtime() - Subscribe to database changes
  • useTableSubscription() - Auto-refetch on changes
  • useTableInserts() - Listen to inserts
  • useTableUpdates() - Listen to updates
  • useTableDeletes() - Listen to deletes

Storage

  • useStorageUpload() - Upload files
  • useStorageList() - List files in bucket
  • useStorageDownload() - Download files
  • useStorageDelete() - Delete files
  • useStorageSignedUrl() - Generate signed URLs
  • useStoragePublicUrl() - Get public URLs

RPC (PostgreSQL Functions)

  • useRPC() - Call PostgreSQL function (query)
  • useRPCMutation() - Call PostgreSQL function (mutation)
  • useRPCBatch() - Call multiple functions in parallel

Admin (Management & Operations)

  • useAdminAuth() - Admin authentication state and login/logout
  • useUsers() - User management with pagination and CRUD
  • useAPIKeys() - API key creation and management
  • useWebhooks() - Webhook configuration and delivery monitoring
  • useAppSettings() - Application-wide settings management
  • useSystemSettings() - System key-value settings storage

📚 Complete Admin Hooks Guide - Comprehensive admin dashboard documentation

Documentation

📚 Complete React Hooks Guide

Core Guides

API Reference

TypeScript Support

All hooks are fully typed. Define your table schemas for complete type safety:

interface Product {
  id: string
  name: string
  price: number
  category: string
}

function ProductList() {
  const { data } = useTable<Product>('products', (q) => q.select('*'))
  // data is typed as Product[] | undefined
  return <div>{data?.[0]?.name}</div>
}

Examples

Check out working examples in the /example directory:

  • React with Vite
  • Next.js App Router
  • Next.js Pages Router
  • Authentication flows
  • Realtime features
  • File uploads

Contributing

Contributions are welcome! Please read our Contributing Guide for details.

License

MIT © Fluxbase

Links