halloid-web-sdk v1.0.21
HalloID Web SDK
Official WEB SDK for HalloID. This library makes the integration with HalloID platform easier because contains all supported operations.
Getting started
In order to integrate with HalloID, you need to have generated the TENANT_URL and the CLIENT_ID values. If you want to know more about this, you can visit our Client Onboarding guidelines.
Once you are onboarded in HalloID platform, in your Node application (JS, TS), just download the package from NPM:
npm -i halloid-web-sdk
In your application code, you can initialize the client calling the HalloIDWebSDK
constructor:
import HalloIDWebSDK from "halloid-web-sdk";
halloClient: HalloIDWebSDK
// Class code
constructor() {
this.halloClient = new HalloIDWebSDK("TENANT_URL", "CLIENT_ID");
}
Supported Operations
Validate Browser
All modern browsers actually support webauthn API, but in case you want to double check it before executing any operation, the HalloID Web SDK offers a very useful method:
this.halloClient.isBrowserSupported() // returns true or false
Register
Allow users to register into your platform with a single step.
await this.halloClient.registerUser("username", "SERVICE_TOKEN").then(response => {
console.log(response) //Returns the signed JWT token
}).catch(reason => {
console.log(reason)
});
Login
Allow users to login into your platform with a single step.
await this.halloClient.login("username", "SERVICE_TOKEN").then(response => {
console.log(response) //Returns the signed JWT token
}).catch(reason => {
console.log(reason)
});
Generate NPM artifact
To generate the NPM artifact, run the following command in the root directory:
npm run build
The generated dist
folder contains the transpiled code.
Uploading to NPM
Make sure the version number is updated in the package.json file before performing any build/update operation. Then run:
npm publish