Skip to content

PlusAuth/plusauth-web

Repository files navigation

@plusauth/web

PlusAuth helper utility intended to use in browsers.

Table of Contents

  1. Installation
  2. Usage
  3. Docs

Installation

From PlusAuth CDN (Make sure to check version):

<!-- Latest release -->
<script src="https://unpkg.com/@plusauth/[email protected]/dist/plusauth-web.umd.js"></script>

With npm:

$ npm install @plusauth/web

or with yarn

$ yarn add @plusauth/web

Usage

CDN Usage

The library will be exposed to global as plusauthweb

Initialize it like following:

const plusAuth = new plusauthweb.PlusAuthWeb('https://<YOUR_TENANT_ID>.plusauth.com')

// access auth methods
plusAuth.auth.signIn({ username: 'test', password: 'test' })

// access mfa methods
plusAuth.mfa.validateCode('CODE', plusauthweb.MFACodeType.SMS)

NPM Usage

import { PlusAuthWeb, MFACodeType } from '@plusauth/web'

const plusAuth = new PlusAuthWeb('https://<YOUR_TENANT_ID>.plusauth.com')

// access auth methods
plusAuth.auth.signIn({ username: 'test', password: 'test' })

// access mfa methods
plusAuth.mfa.validateCode('CODE', MFACodeType.SMS)

Docs

For API docs visit here