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

@wefterjs/biometric

v0.0.1

Published

Official Wefter plugin for native biometric authentication (Face ID, Touch ID, Android BiometricPrompt).

Readme

@wefterjs/biometric

Official Wefter plugin for native biometric authentication (Face ID, Touch ID, Android BiometricPrompt).


Features

  • 🔒 Native Security: Uses Android androidx.biometric.BiometricPrompt & iOS LocalAuthentication (LAContext).
  • 👆 Multi-Biometry: Supports Fingerprint, Face ID, Touch ID, and Iris authentication.
  • 🔑 Device Passcode Fallback: Optional OS passcode fallback if biometrics are not configured or fail.
  • Zero Reflection: Routes direct to Kotlin/Swift dispatchers with invokeNative.

Installation & Setup

  1. Add the plugin to your Wefter project:
wefter add @wefterjs/biometric
  1. Synchronize native projects:
wefter sync

Native Permissions & Manifest Configuration

  • Android (AndroidManifest.xml): Automatically requests <uses-permission android:name="android.permission.USE_BIOMETRIC" />.
  • iOS (Info.plist): Automatically injects NSFaceIDUsageDescription.

JavaScript API Reference

Import invokeNative from @wefterjs/core:

import { invokeNative } from "@wefterjs/core";

1. isAvailable()

Checks if biometric hardware is present, enrolled, and ready for authentication on the device.

interface BiometricAvailability {
  available: boolean;
  biometryType: "face" | "touch" | "iris" | "none";
  error?: string;
}

const status = await invokeNative<BiometricAvailability>("biometric", "isAvailable");

if (status.available) {
  console.log(`Biometrics supported: ${status.biometryType}`);
} else {
  console.log(`Biometrics unavailable: ${status.error}`);
}

2. authenticate(options)

Triggers the OS native biometric prompt dialog.

interface AuthenticateOptions {
  reason?: string; // Display prompt reason (e.g. "Confirm your identity to unlock funds")
  fallbackTitle?: string; // Custom button label for OS passcode fallback
  allowDeviceCredential?: boolean; // Allow PIN / Pattern / Passcode fallback
}

interface AuthenticateResult {
  success: boolean;
  error?: string;
}

try {
  const result = await invokeNative<AuthenticateResult>("biometric", "authenticate", {
    reason: "Authenticate to access your secure wallet",
    fallbackTitle: "Use Device PIN",
    allowDeviceCredential: true,
  });

  if (result.success) {
    console.log("Authentication successful!");
  }
} catch (error) {
  console.error("Biometric prompt cancelled or failed:", error);
}

Complete Usage Example

import { invokeNative } from "@wefterjs/core";

export async function unlockApp(): Promise<boolean> {
  const status = await invokeNative<{ available: boolean }>("biometric", "isAvailable");

  if (!status.available) {
    alert("Biometric hardware is not configured on this device.");
    return false;
  }

  const response = await invokeNative<{ success: boolean }>("biometric", "authenticate", {
    reason: "Log into your account",
  });

  return response.success;
}