1.1.8 • Published 4 years ago

@orbis-systems/new-account-api-client v1.1.8

Weekly downloads
1
License
-
Repository
-
Last release
4 years ago

This is in early development and is not ready for implementation.

This library comes comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.

Installation

npm i -s @orbis-systems/new-account-api-js

Inclusion

Node

require("babel-core/register");
require("babel-polyfill");

const APIClient = require("@orbis-systems/new-account-api-js");

or

require("babel-core/register");
require("babel-polyfill");

import APIClient from '@orbis-systems/new-account-api-js';

Browser

<script src="browser-bundle.js"></script>

Usage

Node

const config = {
   base_url: 'https://example.com/', // Obtained from Orbis
};

(async () => 
{
    let client = new APIClient(config);
    await client.login('email', 'password', true); 
});

Browser

const config = {
   base_url: 'https://example.com/', // Obtained from Orbis
};

var client = new APIClient(config)
client.login('email', 'password', true);

Session Stores

By default, the session store will use LocalStorage. In the browser, LocalStorage will utilize localStorage, and in NodeJS it will store them in ./session.

You can create a custom session store by extending the SessionStore class. To use it, pass it as the session_store on the config like:

const config = {
   ...
   session_store: CustomStore,
   ...
};

You must implement the methods:

  • get(key)
  • set(key, value, expiration_in_minutes)
  • has(key) (Returns boolean. Should also return false if it has expired)
1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

6 years ago