open-index/open-npm huggingface dataset:
npm package: @haventec/authenticate-web-sdk
Description: Haventec Authenticate Web SDK
Author: Haventec
Latest version: 1.6.0



# 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.
npm package: @haventec/common-web-sdk
Description: Haventec Common Web SDK
Author: Haventec
Latest version: 1.2.8

# Haventec Common Web SDK

A common collection of javascript functions to facilitate client-side interaction.

## Installation

`npm install @haventec/common-web-sdk`

## General Usage

The common-web-sdk is exported as a default export and call be directly consumed by Javascript/Typescript file. 
```
import haventecCommon from '@haventec/common-web-sdk' 
let haventecCommon = require ('@haventec/common-web-sdk' ) 
```
However,  the implementation requires window object (browser) and wouldn't function in a node.js environment. 

## Methods 


* **hashPin:** It returns the hashed pin.

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

* **generateSalt:** It returns the salt to be used while hashing.


## 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.