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

@tacobase/react

v0.1.4

Published

tacobase React components — drop-in auth UI and hooks

Readme


Drop-in React bindings for tacobase — auth state, live data, and realtime updates with zero boilerplate.

npm install @tacobase/react

Table of Contents


Wrap your app

Everything flows from TacoProvider. Put it at the root.

import { TacoProvider } from '@tacobase/react'

export default function App() {
  return (
    <TacoProvider
      url={process.env.NEXT_PUBLIC_TACOBASE_URL!}
      apiKey={process.env.NEXT_PUBLIC_TACOBASE_API_KEY!}
    >
      <YourApp />
    </TacoProvider>
  )
}

useAuth

Auth state, no assembly required.

import { useAuth } from '@tacobase/react'

function Header() {
  const { user, signIn, signOut, signUp, loading } = useAuth()

  if (loading) return <p>Wrapping up...</p>

  return user ? (
    <div>
      <span>Hey, {user.email} 👋</span>
      <button onClick={signOut}>Sign out</button>
    </div>
  ) : (
    <button onClick={() => signIn({ email: '[email protected]', password: '...' })}>
      Sign in
    </button>
  )
}

Full API

const {
  user,            // RecordModel | null — current user
  loading,         // boolean — true during initial auth check
  signUp,          // (credentials) => Promise<{ token, record }>
  signIn,          // (credentials) => Promise<{ token, record }>
  signInWithOAuth, // ({ provider }) => Promise<{ token, record }>
  signOut,         // () => void
} = useAuth()

useCollection

Live data, always fresh. Fetches, paginates, and re-fetches automatically. Realtime updates included.

import { useCollection } from '@tacobase/react'

function PostList() {
  const { data, loading, error, refresh } = useCollection('posts', {
    filter: 'published = true',
    sort: '-created',
    page: 1,
    perPage: 20,
  })

  if (loading) return <p>Loading the goods...</p>
  if (error) return <p>Something went wrong 🌶️</p>

  return (
    <ul>
      {data?.items.map((post) => (
        <li key={post.id}>{post.title}</li>
      ))}
    </ul>
  )
}

Options

useCollection('posts', {
  filter: 'status = "active"',  // tacobase filter expression
  sort: '-created',              // prefix with - for descending
  expand: 'author,comments',    // expand relations
  page: 1,
  perPage: 20,
  realtime: true,                // auto-update on changes (default: true)
})

Return value

const {
  data,     // { items: T[], totalItems: number, totalPages: number } | null
  loading,  // boolean
  error,    // Error | null
  refresh,  // () => void — manually re-fetch
} = useCollection('posts')

useRealtime

Raw realtime subscriptions when you need them.

import { useRealtime } from '@tacobase/react'

function LiveFeed() {
  const [events, setEvents] = useState([])

  useRealtime('posts', (event) => {
    // event.action: 'create' | 'update' | 'delete'
    // event.record: the affected record
    setEvents((prev) => [event, ...prev])
  })

  return (
    <ul>
      {events.map((e, i) => (
        <li key={i}>{e.action}: {e.record.title}</li>
      ))}
    </ul>
  )
}

useClient

Need the full SDK? Grab it from context.

import { useClient } from '@tacobase/react'

function MyComponent() {
  const db = useClient()

  const handleUpload = async (file: File) => {
    const formData = new FormData()
    formData.append('image', file)
    await db.collection('uploads').create(formData)
  }
}

Full example

A live blog feed with auth, data, and realtime — under 40 lines.

import { TacoProvider, useAuth, useCollection } from '@tacobase/react'

function BlogFeed() {
  const { user, signOut } = useAuth()
  const { data, loading } = useCollection('posts', {
    filter: 'published = true',
    sort: '-created',
    realtime: true, // updates live as posts are published
  })

  return (
    <div>
      <header>
        {user && <button onClick={signOut}>Sign out</button>}
      </header>

      {loading ? (
        <p>Wrapping up...</p>
      ) : (
        <ul>
          {data?.items.map((post) => (
            <li key={post.id}>
              <h2>{post.title}</h2>
              <p>{post.content}</p>
            </li>
          ))}
        </ul>
      )}
    </div>
  )
}

export default function App() {
  return (
    <TacoProvider
      url={process.env.NEXT_PUBLIC_TACOBASE_URL!}
      apiKey={process.env.NEXT_PUBLIC_TACOBASE_API_KEY!}
    >
      <BlogFeed />
    </TacoProvider>
  )
}

Related packages

| Package | Description | |---|---| | @tacobase/client | Core SDK — CRUD, auth, realtime, storage | | @tacobase/cli | CLI — taco init, taco dev, taco typegen | | @tacobase/taco | Drop-in AI context — installs client + writes TACOBASE.md | | @tacobase/mcp-server | MCP server — let your AI manage schema via natural language |


tacobase.dev · docs · github

License

MIT