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

passkey-sdk-kit

v1.0.47

Published

This SDK is for creating and authenticating users with passkey

Downloads

13

Readme

Passkey SDK Kit

A modern JavaScript/TypeScript SDK for implementing passkey authentication in web applications. This SDK provides a simple and secure way to register and authenticate users using WebAuthn passkeys.

Note: This SDK is for web-based applications only.


Features

  • 🔐 Secure Authentication: Uses WebAuthn standards for passkey authentication
  • 🌐 Web Only: Designed for browser environments
  • 🔧 Easy Integration: Simple API for quick implementation
  • 📦 TypeScript Support: Full TypeScript definitions included

Cross-Platform Support

For Mobile Applications (Android & iOS): If you want to set passkey for Android and iOS both, the same API key can be used. You need to provide the following information:

  • Android APK KeyHash
  • Apple TeamId
  • Android packageName
  • Android SHA-256 certificate fingerprints

For more details, refer to passkey-sdk-kit-mobile


Step-by-Step Integration Guide

Step 1: Installation

npm install passkey-sdk-kit

Step 2: Subscription Setup

To subscribe to the Passkey SDK, follow these steps:

  1. Pay the subscription fee.

  2. Provide the following platform details:

    • Project Name
    • Platform URL
    • Android APK KeyHash
    • Apple TeamId
    • Android packageName
    • Android SHA-256 certificate fingerprints
  3. After verification, you will receive:

    • API Key – Used to initialize the SDK instance on the client.
    • Secret Key – Used on your backend to verify JWT tokens signed with HS256.

Step 3: Import and Initialize

import { PasskeySDK } from "passkey-sdk-kit";

const uId = "<unique-user-id>";
const sdk = new PasskeySDK("<API-KEY>");

Step 4: Initialize SDK

await sdk.init(); // Required before any other operations

Step 5: User Registration

const registerPasskey = async () => {
  try {
    await sdk.init();

    const response = await sdk.registerPasskey(uId, {
      email: "[email protected]",
      name: "Test",
    });

    if (response) {
      checkPasskey();
      alert("Passkey added successfully");
    }
  } catch (error) {
    console.error("Error during registration:", error);
  }
};

Step 6: User Login

const loginWithPasskey = async () => {
  try {
    await sdk.init();
    const response = await sdk.loginWithPasskey();

    if (response) {
      const jwtToken = response?.data?.token;
      if (jwtToken) {
        console.log("JWT Token:", jwtToken);
        setLoginStatus(true);
        alert("Logged in successfully");
      }
    }
  } catch (error) {
    console.error("Error during login with passkey:", error);
  }
};

Step 7: Check Passkey Status

const checkPasskey = async () => {
  try {
    await sdk.init();
    const response = await sdk.checkPasskeyStatus(uId);
    if (response) {
      setPasskeyStatus(response?.data?.isPasskeyEnabled);
    }
  } catch (error) {
    console.error("Error fetching passkey status:", error);
  }
};

Step 8: Delete Passkey (Optional)

const deletePasskey = async () => {
  try {
    await sdk.init();
    const response = await sdk.deletePasskey(uId);
    if (response) {
      checkPasskey();
      alert("Passkey deleted successfully");
    }
  } catch (error) {
    console.error("Error deleting passkey:", error);
  }
};

Step 9: Backend JWT Verification

To authenticate the JWT received during login, use this code:

import jwt from "jsonwebtoken";

const response = jwt.verify(jwtToken, secretKey);

// response structure:
{
  exp: 1753094467,
  iat: 1753094347,
  timestamp: 1753094347701,
  uId: "sdc23sdaf4567ertkdsjlk"
}

Use the uId to securely associate or authenticate the user within your platform.


🔐 Registration & Authentication Flow

  • During registration, provide a unique identifier (uId) for the user. This will:

    • Be used to register the passkey.
    • Be embedded in the JWT returned by the SDK during login.
  • During login, the SDK returns a JWT token.

  • On your backend:

    • Verify the JWT using the secret key.
    • Extract the uId from the token payload.
    • Use the uId to authenticate or link to the user session securely.

Browser Compatibility

Requires a browser that supports:

  • WebAuthn API
  • crypto.getRandomValues()
  • Modern JavaScript (ES2020+)

Supported browsers:

  • Chrome 67+
  • Firefox 60+
  • Safari 13+
  • Edge 18+

Security Considerations

  • Always use HTTPS in production
  • Store API keys securely
  • Follow security best practices for your application

License

MIT License - see LICENSE file for details.