@spiretechnology/js-webauthn
TypeScript icon, indicating that this package has built-in type declarations

1.1.5 • Public • Published

js-webauthn

A TypeScript / JavaScript library for registering and authenticating with WebAuthn.

This library is intended to integrate with the Go backend library spiretechnology/go-webauthn. Together, these two libraries will abstract away the complexities of WebAuthn encoding, decoding, verification, etc.

Installation

npm install --save @spiretechnology/js-webauthn

Example usage

import { WebAuthnClient } from '@spiretechnology/js-webauthn';

const client = new WebAuthnClient();

async function register() {
    // Request a challenge from the server
    const challenge = //...

    // Register a device with the WebAuthn client
    const response = await client.register(challenge);

    // Send the response to the server
    // ...
}

async function authenticate() {
    // Request a challenge from the server
    const challenge = //...

    // Authenticate with the WebAuthn client
    const response = await client.authenticate(challenge);

    // Send the response to the server
    // ...
}

Other resources

Readme

Keywords

Package Sidebar

Install

npm i @spiretechnology/js-webauthn

Weekly Downloads

3

Version

1.1.5

License

MIT

Unpacked Size

37.2 kB

Total Files

36

Last publish

Collaborators

  • connerdouglass