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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@hydevs/hypb

v0.0.28

Published

<img src="https://github.com/Hydevs-Corp/Hypb/blob/9308ab4c17196e5c0083c983a528326fd2cba867/.github/assets/banner.png" alt="usehooks-ts banner" align="center" />

Downloads

32

Readme

Hypb

NPM React React Native TypeScript Vite

React hooks and utils for the user-friendly database and API solution :

Summary

Install

npm i @hydevs/hypb

Authors

Hypb was made and is maintained by Louis Réville 🇫🇷 and and Guillaume Maugin 🇫🇷 to simplify starting and developping webapps.

🤝 Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page.

npm i @hydevs/hypb

How to use it ?

1. Initialize Pocketbase Config

You can either use your PocketBase url :

import { Hypb } from "@hydevs/hypb";

Hypb.initPB("https://urlToYourPb.io/", {
    autoCancelation: false /* default: true */,
    userCollection: "users" /* default: "_pb_users_auth_" */,
});

Or use an existing PocketBase instance

import { Hypb } from "@hydevs/hypb";
import Pocketbase from "pocketbase";

const pb = new Pocketbase("https://urlToYourPb.io/");
pb.autoCancelation(false);

Hypb.initPB("https://urlToYourPb.io/", {
    autoCancelation: true,
    userCollection: "users",
});

Once you've initialized Hypb, you can access the pocketbase object through the Hypb.getPB() method and use it as in the pocketbase documentation

import { Hypb } from "@hydevs/hypb";

function Component() {
    const pb = Hypb.pb;

    return <div></div>;
}

Referencing your PB instance in Hypb is the first prerequisite to let you use our hooks and utils in your application, by making your pb instance accessible to the entire package.

2. Collections and Records Hooks

useCollection is used to request every entries from a collection, and store the result as a state. Allows also for real time subscriptions.

It supports : loading and invalidates as well as pagination

import { useCollection } from "@hydevs/hypb";

// defining all options
const defaultValue = []; // Default value for your collection
const queryParams = {
    // Specify the params for the request
    filter: "...",
    sort: "...",
};
const pageParams = {
    // Chooses page parameters | Defaults are : page 1 and 50 items per pages
    perPages: 10,
    page: 1,
};
const useCollectionOptions = {
    queryParams,
    pageParams,
    realtime: true, // Allows for realtime subscription
};

const Component = () => {
    const {
        records: notes,
        invalidate, // manualReload
        loading, // true while there's no responses from the db, false otherwise
        params, // actual params
        pageInfos, // page, perPage, totalItems
        setPage, // method to change page, setPage(pageInfos.page + 1)
    } = useCollection < note > ("notes", defaultValue, useCollectionOptions);

    return (
        <>
            {loading
                ? "loading..."
                : notes.map((note) => <div key={node.id}> {note.text} </div>)}
        </>
    );
};

3. AuthProvider & AuthHooks

import { AuthProvider } from "@hydevs/hypb";
import { RecordModel } from "pocketbase";

function App() {
    return (
        <AuthProvider>
            <YourApp />
        </AuthProvider>
    );
}

You can now, anywhere in your app, login, logout, and access to the userData

import { useUserData, loginPB, logoutPB } from "@hydevs/hypb";

const Component = () => {
    const { userData, loading, invalidate: manualReload } = useUserData();

    return (
        <>
            <button onClick={() => loginPB("<username>", "<password>")}>
                Login with PocketBase
            </button>
            <button onClick={logoutPB}> Logout </button>
            {userData && <p>userData</p>}
        </>
    );
};

Notes

AuthProvider contains additionnal props that you can find in his AuthProviderProps :

type AuthProviderProps = {
    children: React.ReactNode;
    initialEmptyUser: RecordModel /* default: {} as RecordModel */;
    expand?: string;
};

4.