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

@unifold/react-provider

v0.1.20

Published

Unifold React Provider - Core provider and context for Unifold React SDKs

Downloads

2,152

Readme

@unifold/react-provider

Minimal React provider for Unifold SDKs. This package provides only the essential publishableKey context and QueryClient setup that is shared across all Unifold React-based SDKs.

Purpose

This package is designed to be the universal, minimal provider for:

  • @unifold/connect-react - Full UI SDK with modal components
  • @unifold/headless-react - Headless SDK with hooks only (coming soon)
  • Any future React-based Unifold SDKs

Installation

npm install @unifold/react-provider
# or
pnpm add @unifold/react-provider

Note: This package is typically installed automatically as a dependency of @unifold/connect-react or @unifold/headless-react. You don't need to install it directly unless you're building a custom SDK.

Usage

Basic Setup

import { UnifoldProvider } from '@unifold/react-provider';

function App() {
  return (
    <UnifoldProvider publishableKey="pk_test_...">
      <YourApp />
    </UnifoldProvider>
  );
}

Using the Context

import { useUnifold } from '@unifold/react-provider';

function MyComponent() {
  const { publishableKey } = useUnifold();
  
  return <div>Connected with key: {publishableKey}</div>;
}

API

UnifoldProvider

The main provider component that wraps your application.

Props:

  • publishableKey (required): Your Unifold API publishable key
  • children (required): Your React components

useUnifold

Hook to access the Unifold context.

Returns:

  • publishableKey: Your API key

Features

  • QueryClient Setup: Automatically configures React Query for optimal performance
  • API Key Validation: Validates publishable keys on mount
  • SSR Support: Safe to use with server-side rendering
  • TypeScript: Full type definitions included
  • Ultra-Lightweight: Minimal bundle size (~2 KB)
  • Zero Configuration: Only requires publishableKey

Design Philosophy

This package intentionally stays minimal and only handles:

  1. publishableKey management
  2. React Query setup
  3. SSR-safe context

All SDK-specific configuration (apiUrl, defaultConfig, etc.) is handled by the higher-level packages (@unifold/connect-react, @unifold/headless-react) that wrap this provider.

Architecture

This package sits at the base of the Unifold React ecosystem:

@unifold/react-provider (this package)
  └─ publishableKey + QueryClient only

@unifold/connect-react
  ├─ Wraps: @unifold/react-provider
  ├─ Adds: apiUrl, appName, defaultConfig
  └─ Provides: UI components, modal flows

@unifold/headless-react (coming soon)
  ├─ Wraps: @unifold/react-provider
  ├─ Adds: apiUrl, custom config
  └─ Provides: Headless hooks, custom UI

License

MIT