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

@zenku/sdk

v0.3.2

Published

SDK for building apps with Zenku — auth, RBAC, file storage, and migrations

Readme

@zenku/sdk

SDK for building RBAC apps with PocketBase.

Install

npm install @zenku/sdk
# or
pnpm add @zenku/sdk

Install the peer dependencies you need based on which subpaths you use:

# Required for all subpaths
pnpm add pocketbase

# For API apps (./hono, ./hono/env, ./rbac/superuser)
pnpm add hono zod

# For web apps (./react/auth, ./react/token-callback)
pnpm add react

Subpath Exports

Server / API

@zenku/sdk/hono

Hono app factory with CORS, health checks, error handling, and standalone PocketBase JWT auth middleware.

import { createBaseApp, createAuthMiddleware } from "@zenku/sdk/hono";
import type { AuthUser } from "@zenku/sdk/hono";

const { app } = createBaseApp({ serviceName: "my-api" });

app.use(
  "*",
  createAuthMiddleware({
    pbUrl: "https://pb.example.com",
    excludePaths: ["/health"],
  }),
);

app.get("/me", (c) => {
  const user = c.get("user") as AuthUser;
  return c.json({ id: user.id, email: user.email });
});

@zenku/sdk/hono/env

Base environment schema and loader for API apps.

import { baseEnvSchema, createEnvLoader } from "@zenku/sdk/hono/env";

const envSchema = baseEnvSchema.extend({
  PORT: z.coerce.number().default(3600),
});

@zenku/sdk/rbac

RBAC client for managing accounts, roles, members, and invitations.

import { createPocketBaseExtensions } from "@zenku/sdk/rbac";

@zenku/sdk/rbac/superuser

Server-only PocketBase superuser client with auto-reauth.

import { createSuperuserClient } from "@zenku/sdk/rbac/superuser";

Client / React

@zenku/sdk/react/auth

Auth context factory for React apps. Creates an AuthProvider component and useAuth hook bound to a PocketBase instance.

import { createAuth } from "@zenku/sdk/react/auth";
import PocketBase from "pocketbase";

const pb = new PocketBase("https://pb.example.com");
pb.autoCancellation(false);

// Pass a type parameter for typed user access (recommended).
// UsersResponse can be generated with the zenku-types CLI.
import type { UsersResponse } from "./pocketbase-types";
export const { AuthProvider, useAuth } = createAuth<UsersResponse>(pb);

// Wrap your app with AuthProvider, then use the hook in any component:
// const { isAuthenticated, isLoading, user, logout } = useAuth();
// user?.email — fully typed, no cast needed

@zenku/sdk/react/token-callback

Token callback page for CLI-based login flows. Reads a JWT from the URL fragment, validates it against PocketBase, and saves auth state.

import { TokenCallback } from "@zenku/sdk/react/token-callback";

export default function AuthCallbackPage() {
  return <TokenCallback pbUrl="https://pb.example.com" />;
}

Build-time

@zenku/sdk/migrations

PocketBase migration helpers — field builders, index helpers, condition builders, and API rule presets.

import {
  accountField,
  autodateFields,
  accountIndexes,
  rules,
} from "@zenku/sdk/migrations";

CLI

zenku-types

Generate TypeScript types from PocketBase collections.

npx zenku-types --local --migrations-dir ./pb_migrations
npx zenku-types --url https://pb.example.com --email [email protected] --password secret

License

Proprietary — see LICENSE.