busarm-oauth-client-js
TypeScript icon, indicating that this package has built-in type declarations

1.0.12 • Public • Published

Busarm OAuth Client JS

Description

OAuth 2.0 JS Client based on RFC6749 standards

Documentation

Install - Nodejs

  • Install package. Run npm i busarm-oauth-client-js
  • Import module
import { Oauth } from "busarm-oauth-client-js";

Install - Browser

<script
    rel="script"
    src="./dist/busarm-oauth.min.js"
    type="text/javascript"
></script>

Versions

v1.0.10

  • Replace XMLHttpRequest with Axios
  • Added support for browsers with plain JS. Access using BusarmOAuth or window.BusarmOAuth

v1.0.4

  • Added custom storage option OauthStorageInterface to handle custom access storage
    class CustomStorage implements OauthStorageInterface<string> {
      get(key: string): Promise<string> {
        return new Promise((resolve) => {
          resolve(YOUR_CUSTOM_STORAGE.get(key));
        });
      }
      set(key: string, value: string): Promise<void> {
        return new Promise((resolve) => {
          resolve(YOUR_CUSTOM_STORAGE.set(key, value));
        });
      }
      remove(key: string): Promise<any> {
        return new Promise((resolve) => {
          resolve(YOUR_CUSTOM_STORAGE.remove(key));
        });
      }
      clearAll(): Promise<any> {
        return new Promise((resolve) => {
          resolve(YOUR_CUSTOM_STORAGE.clearAll());
        });
      }
    }

    const oauth = new Oauth({
        ....
        storage: new CustomStorage(); // <Custom storage object>
    });

v1.0.0

  • Initialize project

Development

  • Run npm install
  • Start Gulp - For assets processing and bundling
    • For First time Setup:
      • Install Nodejs & NPM on system
      • Install gulp-cli on system - npm install --global gulp-cli
      • Install npm packages - npm install
    • Run gulp command

Testing

  • Run npm run test

Package Sidebar

Install

npm i busarm-oauth-client-js

Weekly Downloads

2

Version

1.0.12

License

none

Unpacked Size

807 kB

Total Files

14

Last publish

Collaborators

  • busarm-2022