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

@anjunar/scalajs-ui-webauthn

v1.0.6

Published

The browser-side WebAuthn and passkey API for Scala JS UI 1.0, with strict JSON codecs and JSON-safe credential payloads.

Readme

@anjunar/scalajs-ui-webauthn

The browser-side WebAuthn and passkey API for Scala JS UI 1.0. It is independent of the UI component runtime and is the TypeScript counterpart of scalajs-ui-webauthn.

Installation

npm install @anjunar/scalajs-ui-webauthn

Registration and authentication

Use the JSON methods with the options returned by a relying-party backend. The module uses the browser's Level 3 JSON parser when available and has a strict Level 2 fallback for older browsers.

import { authenticateJson, registerJson } from "@anjunar/scalajs-ui-webauthn";

const registration = await registerJson(await fetch("/webauthn/register/options").then((r) => r.json()));
await fetch("/webauthn/register/verify", {
  method: "POST",
  body: JSON.stringify(registration),
  headers: { "content-type": "application/json" },
});

const authentication = await authenticateJson(await fetch("/webauthn/auth/options").then((r) => r.json()));

Already decoded browser dictionaries can be passed to register and authenticate. CredentialCreationSettings and CredentialRequestSettings carry an AbortSignal and mediation mode. All operations return native Promises; the *Promise names are provided as migration-friendly aliases for the Scala.js API.

Capabilities and credential synchronization

import {
  CredentialMediationRequirement,
  isAvailable,
  isConditionalMediationAvailable,
  authenticateJson,
} from "@anjunar/scalajs-ui-webauthn";

if (isAvailable() && await isConditionalMediationAvailable()) {
  await authenticateJson(optionsFromServer, {
    mediation: CredentialMediationRequirement.Conditional,
  });
}

clientCapabilities and the individual capability queries safely return empty or false outside a supporting browser. signalUnknownCredential, signalAllAcceptedCredentials, and signalCurrentUserDetails reject when the browser does not expose the corresponding WebAuthn Level 3 method.

JSON and Base64URL behavior

Credential responses contain base64url strings suitable for sending to a backend. Base64Url is public for application-specific binary fields. credentialToJson uses native PublicKeyCredential.toJSON() where available; the fallback recursively converts binary extension results to base64url.

WebAuthn ceremonies are only the browser boundary. Challenge generation and single use, origin and RP-ID validation, attestation policy, signature verification, sign-count handling, credential storage, and session establishment remain backend responsibilities.

API overview

  • register, registerJson, authenticate, authenticateJson
  • isSupported, isAvailable, and capability queries
  • credential synchronization signal methods
  • typed public-key option facades and WebAuthn value constants
  • Base64Url, WebAuthnCodecs, RegistrationCredential, and AuthenticationCredential