1.1.5 • Published 2 years ago

@spiretechnology/js-webauthn v1.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago