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

@useauthio/widgets

v0.3.2

Published

Embeddable React widgets for Authio: drop the SSO Connection and Directory Sync surfaces into your own product so your IT-admin customers self-serve enterprise setup without leaving your app.

Readme

@useauthio/widgets

Part of Authio Lobby — Authio's drop-in passwordless authentication. The widgets are the embeddable Lobby pieces. Learn more at https://authio.com/products/lobby.

Drop-in React widgets that let your customers' IT admins configure SSO connections and Directory Sync inside your own product — no dashboard bounce.

Install

pnpm add @useauthio/widgets react react-dom

Quick start

import {
  AuthioSSOConnectionWidget,
  AuthioDirectorySyncWidget,
} from "@useauthio/widgets";

function AdminPage({ token, orgId }: { token: string; orgId: string }) {
  return (
    <>
      <AuthioSSOConnectionWidget
        token={token}
        organizationId={orgId}
        onConnectionUpdate={(e) => console.log(e)}
      />
      <AuthioDirectorySyncWidget
        token={token}
        organizationId={orgId}
        onDirectoryUpdate={(e) => console.log(e)}
      />
    </>
  );
}

Localization

Every widget renders in six languages — English, German, French, Spanish, Japanese, Brazilian Portuguese — sharing the exact message catalog the hosted Authio Lobby uses.

Pass the optional locale prop:

<AuthioSSOConnectionWidget token={token} organizationId={orgId} locale="de" />

Resolution order: locale prop → browser language (navigator.languages) → en. The prop is fully additive — omit it and the widget picks the host browser's language (then English), so existing embedders see no change. Any BCP-47-ish tag works and is normalised (de-DEde, pt/pt-PTpt-BR, ENen).

Coded auth-core errors (widget_origin_mismatch, widget_token_expired, …) are translated from the shared error.* catalog; the raw code stays visible for support.

The supported set and resolver are exported for building your own language picker:

import { SUPPORTED_LOCALES, resolveWidgetLocale } from "@useauthio/widgets";

Under the hood: a ~1 KB ICU-lite formatter ({var} / plural / select) backed by the platform's Intl.PluralRules — no message-format dependency, no bundled CLDR tables. The canonical catalog lives in messages/<locale>.json; pnpm build regenerates the tree-shakeable per-namespace runtime via scripts/build-messages.mjs.

Mint a widget token from your backend

The widgets accept short-lived kind: "widget" JWTs. Mint them server-side via POST /v1/widget-tokens on management-api:

const res = await fetch("https://api.authio.com/v1/widget-tokens", {
  method: "POST",
  headers: {
    authorization: `Bearer ${dashboardSessionJwt}`,
    "content-type": "application/json",
    "x-authio-tenant": tenantId,
  },
  body: JSON.stringify({
    organization_id: "org_abc",
    scope: ["sso_connection", "directory_sync"],
    origins: ["https://app.acme.com"],
    ttl_seconds: 1800,
  }),
});
const { token, expires_at } = await res.json();

Bundle budget

Both widgets ship under a strict size ceiling — failing the budget breaks the build:

| Bundle | Gzipped budget | | --------------------- | -------------- | | Per widget | ≤ 16 KB | | Combined (6 widgets) | ≤ 72 KB |

Run pnpm size after pnpm build to verify. The ceiling grew in v0.2 to absorb localization — every widget now ships its own strings in six locales plus the shared common/error catalogs. Tree-shaking still guarantees a widget never carries another widget's strings.

Origin enforcement

Each widget JWT is bound to one or more widget_origins. Every call to auth-core /widget/* validates the request's Origin header against that allow-list and 403s on mismatch. This enforcement is server-side — there is no client-side frame-ancestors CSP gate to defeat.

Imperative mount (non-React hosts)

import { mountSSOConnectionWidget } from "@useauthio/widgets";

const handle = mountSSOConnectionWidget(document.querySelector("#mount")!, {
  token,
  organizationId: "org_abc",
});

// later, when the host rotates the token:
handle.update({ token: newToken, organizationId: "org_abc" });

// on tear-down:
handle.unmount();

What's in the box

  • <AuthioSSOConnectionWidget> — list, create, edit, delete, and test SAML / OIDC connections. Renders the SP metadata XML so the IT admin can paste it into Okta / Entra / JumpCloud.
  • <AuthioDirectorySyncWidget> — provision Okta SCIM, Microsoft Entra ID, Google Workspace, JumpCloud, Rippling, generic SCIM. List synced users, trigger a manual sync, rotate the directory bearer.
  • mountSSOConnectionWidget / mountDirectorySyncWidget — framework- agnostic imperative mount for Vue, Svelte, Angular, vanilla DOM, Web Components, etc.
  • WidgetClient + WidgetError — the underlying typed HTTP client, exposed for power users.

Security model in one paragraph

Widget tokens are a third, fully separate JWT-kind alongside customer and platform tokens. The bearer cannot mint other tokens, cannot drive /v1/sessions/* or /v1/me, and is refused on every other Authio surface with widget_token_not_allowed_here. Every /widget/* call checks the request Origin against the JWT's widget_origins[], checks the per-route scope against widget_scope[], and reads the underlying widget_tokens row by JTI on every call so revocation is DB-backed (not just JWT-exp). TTL defaults to 30 minutes; the DB caps it at 1 hour. Full threat model: docs.authio.com/widgets/security.

Docs

Repo

github.com/authio-com/authio_widgets

License

MIT.