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
- Host: GitHub
- URL: https://github.com/plusauth/plusauth-web
- Owner: PlusAuth
- License: mit
- Created: 2020-05-14T22:40:04.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-06T01:47:33.000Z (about 2 years ago)
- Last Synced: 2024-12-01T06:38:12.552Z (about 1 year ago)
- Topics: plusauth, typescript, typescript-library
- Language: TypeScript
- Homepage: https://plusauth.github.io/plusauth-web/classes/PlusAuthWeb.html
- Size: 2.51 MB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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)