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

@ikeboy003/auth

v0.2.5

Published

Headless Cognito auth/session primitive: configure-at-import from env (or explicit), framework-agnostic core + optional React binding. Drop-in — wire nothing when the env is set. No brand/routing logic baked in.

Readme

@ikeboy003/auth

Headless Cognito auth/session primitive. Framework-agnostic core + optional React binding. Drop-in: when the pool env vars are set, you wire nothing.

No brand, routing, or UI logic baked in — it gives you a session and a token; the app decides where to send people and how to render.

Install

npm i @ikeboy003/auth aws-amplify

aws-amplify and react are peers. React is optional (only needed for /react).

Configure

Zero-config when any of these env pairs are present (checked in order):

  • NEXT_PUBLIC_COGNITO_USER_POOL_ID / NEXT_PUBLIC_COGNITO_CLIENT_ID
  • VITE_COGNITO_USER_POOL_ID / VITE_COGNITO_CLIENT_ID
  • COGNITO_USER_POOL_ID / COGNITO_CLIENT_ID

Admin group defaults to admin (override with NEXT_PUBLIC_AUTH_ADMIN_GROUP).

Bundled apps (Next / Vite): configure explicitly. The env auto-read uses process.env[name] dynamically, and bundlers only inline static process.env.NEXT_PUBLIC_X literals — so in the browser the auto-read sees nothing. Pass the values from your app (where they inline) via the AuthProvider config prop, or configureAuth():

import { configureAuth } from "@ikeboy003/auth";
configureAuth({ userPoolId: "...", userPoolClientId: "...", adminGroup: "admin" });

Core (no React)

import {
  authEnabled, signIn, signOut, getCurrentUser, getIdToken,
} from "@ikeboy003/auth";

const user = await getCurrentUser(); // { sub, email, groups, isAdmin } | null
const token = await getIdToken();    // Cognito ID JWT — send as Bearer for RLS

Pair getIdToken with any postgREST client so row-level security applies:

import { createClient } from "@ikeboy003/cloudrest-client";
export const db = createClient({ baseUrl, getToken: getIdToken });

React

// Wrap once, at the root. In a bundled app, pass config (statically-inlined
// env from YOUR app) so the browser actually gets the pool ids:
import { AuthProvider } from "@ikeboy003/auth/react";
<AuthProvider
  config={{
    userPoolId: process.env.NEXT_PUBLIC_COGNITO_USER_POOL_ID,
    userPoolClientId: process.env.NEXT_PUBLIC_COGNITO_CLIENT_ID,
  }}
>
  {children}
</AuthProvider>;

// Anywhere below it.
import { useAuth } from "@ikeboy003/auth/react";
const { user, loading, signIn, signOut } = useAuth();

License

MIT