-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
23 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ PlusAuth helper utility intended to use in browsers. | |
From PlusAuth CDN: | ||
```html | ||
<!-- Latest release --> | ||
<script src="https://unpkg.com/[email protected].6/dist/plusauth-web.umd.min.js"></script> | ||
<script src="https://unpkg.com/[email protected].7/dist/plusauth-web.umd.min.js"></script> | ||
``` | ||
|
||
With npm: | ||
|
@@ -27,18 +27,31 @@ $ yarn add plusauth-web | |
# Usage | ||
|
||
## CDN Usage | ||
The library will be exposed to global as `PlusAuthWeb` | ||
The library will be exposed to global as `plusauthweb` | ||
|
||
Initialize it like following: | ||
```js | ||
const plusAuth = new PlusAuthWeb('https://<YOUR_TENANT_ID>.plusauth.com') | ||
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 | ||
```js | ||
import PlusAuthWeb from 'plusauth-web' | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters