An open API service indexing awesome lists of open source software.

https://github.com/plusauth/plusauth-web

Authorization utility to be used in PlusAuth rendered views
https://github.com/plusauth/plusauth-web

plusauth typescript typescript-library

Last synced: 6 months ago
JSON representation

Authorization utility to be used in PlusAuth rendered views

Awesome Lists containing this project

README

          

# @plusauth/web
PlusAuth helper utility intended to use in browsers.

## Table of Contents
1. [Installation](#installation)
2. [Usage](#usage)
3. [Docs](#docs)

## Installation
From PlusAuth CDN (Make sure to check version):
```html

```

With npm:
```shell script
$ npm install @plusauth/web
```

or with yarn
```shell script
$ yarn add @plusauth/web
```

# Usage

## CDN Usage
The library will be exposed to global as `plusauthweb`

Initialize it like following:
```js
const plusAuth = new plusauthweb.PlusAuthWeb('https://.plusauth.com')

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

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

## NPM Usage
```js
import { PlusAuthWeb, MFACodeType } from '@plusauth/web'

const plusAuth = new PlusAuthWeb('https://.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](https://plusauth.github.io/plusauth-web/classes/plusauthweb.html)