3.0.1 • Published 7 months ago

passkey_linker v3.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
7 months ago

WebAuthn Authentication Module

WebAuthn Authentication Module is a JavaScript module designed to handle the WebAuthn sign-in and sign-up processes for users. It facilitates secure authentication by interacting with the browser's WebAuthn API and storing credentials in Firestore.

Installation

Install the package via npm:

npm install passkey_linker

Usage

Importing Functions

First, import the handleSignIn and handleSignUp functions from the package:

import handleSignIn from 'passkey_linker/src/auth/handleSignIn';
import handleSignUp from 'passkey_linker/src/auth/handleSignUp';

handleSignIn Description The handleSignIn function is an asynchronous function that handles the WebAuthn sign-in process for a user.

Parameters username (string): The username of the user attempting to sign in. developerId (string): The developer ID associated with the user. projectId (string): The project ID associated with the user. Returns Returns the assertion object if the sign-in process is successful. Returns null if the credential ID is not found. Throws an error if an exception occurs during the process. Example Usage

async function signInUser() {
    try {
        const assertion = await handleSignIn('username', 'developerId', 'projectId');
        if (assertion) {
            console.log('Sign-in successful:', assertion);
        } else {
            console.log('Sign-in failed.');
        }
    } catch (error) {
        console.error('Error during sign-in process:', error);
    }
}

signInUser();

handleSignUp Description The handleSignUp function is an asynchronous function that handles the WebAuthn sign-up process for a user.

Parameters username (string): The username of the user attempting to sign up. platform (boolean): Indicates whether the platform is cross-platform (true) or platform (false). developerId (string): The developer ID associated with the user. projectId (string): The project ID associated with the user. Example Usage

async function signUpUser() {
    try {
        await handleSignUp('username', true, 'developerId', 'projectId');
        console.log('Sign-up successful.');
    } catch (error) {
        console.error('Error during sign-up process:', error);
    }
}

signUpUser();
3.0.1

7 months ago

1.0.19

1 year ago

1.0.2

1 year ago

1.0.18

1 year ago

1.0.1

1 year ago

1.0.17

1 year ago

1.0.0

1 year ago

1.0.16

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

2.0.2

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

2.0.1

1 year ago

1.0.24

1 year ago

2.0.0

1 year ago

1.0.23

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

0.1.0

1 year ago