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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@haventec/authenticate-web-sdk

v1.6.0

Published

Haventec Authenticate Web SDK

Downloads

2,353

Readme

Haventec Authenticate Web SDK

A collection of javascript functions to facilitate client-side integration with Haventec Authenticate.

Installation

npm install @haventec/authenticate-web-sdk

General Usage

The authenticate-web-sdk is not exported as a default export and an instance of it should be created for each user.

import { HaventecAuthenticate } from '@haventec/authenticate-web-sdk' 
let haventecAuthenticate = new HaventecAuthenticate();

The implementation requires the window object (browser) and will not function in a node.js environment.

Angular Usage:

export function HaventecAuthenticateFactory() {
    return new HaventecAuthenticate();
};

export let HaventecAuthenticateProvider = { provide: HaventecAuthenticate,
    useFactory: HaventecAuthenticateFactory,
    deps: []
};

Then you can add HaventecAuthenticateProvider to the providers array of the @NgModule, and inject HaventecAuthenticate into the constructors of @Components as is standard.

Methods

  • initialiseStorage: It sets the current user, with data, initialising the salt if not already set. Any existing data is not overridden, so effectively enables use switching. Optionally can regenerate the salt.

  • updateStorage: It updates the storage with the object passed as parameter.

  • getDeviceName: It returns device-name set by default.

  • clearAccessToken: It clears the access-token for the active user.

  • getAccessToken: It returns the access-token of the user.

  • getUsername: It returns username of the current user.

  • getActiveUsernames: It returns the usernames of all activated users.

  • getDeviceUuid: It returns the uuid of the device generated through authenticate.

  • getUserUuid: It returns the uuid of the current user.

  • getWebAuthnDeviceUuid: It returns the uuid of the authenticator for the validated webAuthn credential of the current user.

  • getAuthKey: It returns the current authKey of the current user from Storage.

  • getSalt: It returns the generated salt value for the current user from Storage.

  • setSalt: It sets the salt value for the current user to Storage.

  • regenerateSalt: It regenerates the salt value for the current user to Storage.

  • clearUserStorage: It clears the entire local and session storage used by the user.

  • hashPin: It returns a SHA-512 Hashing of the PIN passed as argument.

  • getDeviceInfo: It returns the information about device including the fingerprint.

  • getWebAuthnSupported: It returns the webAuthnSupported status of the user from Storage.

Development

To build and publish locally, clone the project and run the following:

npm install
npm pack / npm publish

License

This code is available under the MIT license. A copy of the license can be found in the LICENSE file included with the distribution.