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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@blackcube/aurelia2-webauthn

v2.3.1

Published

Blackcube Aurelia 2 Webauthn

Downloads

24

Readme

Blackcube Aurelia 2 webauthn toolkit

This toolkit allows easy setup of Webauthn.

Install

Package is available on npm

Then you can install the package:

npm install @blackcube/aurelia2-webauthn

Howto

There are 2 main processes:

  1. Register a device
  2. login with a device

Those processes are based on the Webauthn standard and need webservices server side.

Youn can find a Yii2 module tohandle the server side part here: Yii2 Webauthn module

Services

5 services methods are available:

  • isAvailable(): Promise<boolean> to check if the browser supports Webauthn
  • registerDevice(email: string, name: string|null = null): Promise<boolean> to register a device ,and create associated user
  • attachDevice(): Promise<any> to attach a device to logged user
  • login(email: string): Promise<boolean> to login a specific user with a device
  • loginDevice(): Promise<boolean> to login with a device and let the user select the passkey

Registering it in app

import Aurelia, { ConsoleSink, LoggerConfiguration, LogLevel} from 'aurelia';
import { WebauthnConfiguration } from "@blackcube/aurelia2-webauthn";
import { MyApp } from './my-app';
Aurelia
    .register(WebauthnConfiguration)
    .register(LoggerConfiguration.create({
        level: LogLevel.trace,
        colorOptions: 'colors',
        sinks: [ConsoleSink]
    }))
    .app(MyApp)
    .start();

Additional configuration if needed

You can configure the toolkit by passing a configuration object to the configure method:

import Aurelia, { ConsoleSink, LoggerConfiguration, LogLevel} from 'aurelia';
import { WebauthnConfiguration } from "@blackcube/aurelia2-webauthn";
import { MyApp } from './my-app';
Aurelia
    .register(WebauthnConfiguration.configure({
        prepareAttachDeviceUrl: '/webauthn/prepare-attach-device',
        prepareRegisterDeviceUrl: '/webauthn/prepare-register-device',
        validateRegisterUrl: '/webauthn/validate-register',
        prepareLoginUrl: '/webauthn/prepare-login',
        prepareLoginDeviceUrl: '/webauthn/prepare-login-device',
        validateLoginUrl: '/webauthn/validate-login'
    }))
    .register(LoggerConfiguration.create({
        level: LogLevel.trace,
        colorOptions: 'colors',
        sinks: [ConsoleSink]
    }))
    .app(MyApp)
    .start();

Default values are:

  • prepareAttachDeviceUrl: '/webauthn/prepare-register-user-device',

  • prepareRegisterDeviceUrl: '/webauthn/prepare-register-device',

  • validateRegisterUrl: '/webauthn/register-validate',

  • prepareLoginUrl: '/webauthn/prepare-login-user-device',

  • prepareLoginDeviceUrl: '/webauthn/prepare-login-device',

  • validateLoginUrl: '/webauthn/login-validate'

  • prepareAttachDeviceUrl URL used to prepare the attach device process

  • prepareRegisterDeviceUrl URL used to prepare the register device process

  • validateRegisterUrl URL used to validate the register/attach process

  • prepareLoginUrl URL used to prepare the login process for a specific user

  • prepareLoginDeviceUrl URL used to prepare the login device process

  • validateLoginUrl URL used to validate the login process

Usage in HTML

Simple components are available to use the toolkit in HTML.

Webauthn login

<template>
    <div class="mx-auto max-w-7xl sm:px-6 lg:px-8">
        <h2 class="py-5 text-xl font-semibold leading-7 text-gray-900">Webauthn login</h2>

        <bc-webauthn-login user.bind="false" route="home"></bc-webauthn-login>
    </div>
</template>

Bindable properties are:

  • user : boolean, if true, the component will show a text input to enter the email of the user to login
  • route : string, the route to redirect to after a successful login (needs routing to be configured)
  • url : string, the url to redirect to after a successful login (if routing is not set)

Webauthn register

<template>
    <div class="mx-auto max-w-7xl sm:px-6 lg:px-8">
        <h2 class="py-5 text-xl font-semibold leading-7 text-gray-900">Webauthn register</h2>

        <bc-webauthn-register></bc-webauthn-register>
    </div>
</template>

Bindable properties are:

  • user : boolean, if true, the component will show a text input to enter the email and create a new user. If false, the component will use the logged user and attach the device to it
  • route : string, the route to redirect to after a successful register (needs routing to be configured)
  • url : string, the url to redirect to after a successful register (if routing is not set)