@habloapp/unicauth-wrapper
v1.0.3
Published
Unic Auth wrapper for Unic Auth SDK.
Downloads
5
Maintainers
Readme
unicauth
Unic Auth Wrapper - Node.js client for Unic Auth API
Unic Auth allows you to quickly implement userless/passwordless login and 2FA (no more paying for SMS to have 2FA)
Installation
First make sure to get your credentials on Unic Auth, if you want to test first, use Unic Auth - Demo
For Node.js
npm
Install it via:
npm install @habloapp/unicauth-wrapper --save
Getting Started
Please follow the installation instruction and execute the following JS code:
var unicauthwrapper = require('@habloapp/unicauth-wrapper');
unicauthwrapper.configure({
appKey: APPLICATION_APPKEY,
readKey: APPLICATION_READKEY,
writeKey: APPLICATION_WRITEKEY,
})
try {
let data = await unicauthwrapper.create2FA(customID, returnUrl, webhookUrl, phone, email, question, userID, mobileReturnUrl)
console.log('API called successfully. Returned data: ' + data);
} catch (error) {
console.error(error);
}
Documentation
- unicauthwrapper.configure(config)
- unicauthwrapper.create2FA(customID, returnUrl, webhookUrl, phone, email, question, userID, mobileReturnUrl)
- unicauthwrapper.getSession(s)
- unicauthwrapper.getUserSession(sessionID, userID)
- unicauthwrapper.expireUserSession(sessionID, userID)