@habloapp/unicauth-wrapper

1.0.3 • Public • Published

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)

Package Sidebar

Install

npm i @habloapp/unicauth-wrapper

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

7.46 kB

Total Files

5

Last publish

Collaborators

  • unicauth