0.0.6 • Published 5 years ago

@sandbx_npm/ace-sdk-browser v0.0.6

Weekly downloads
2
License
MIT
Repository
-
Last release
5 years ago

Ace authorisation SDK

Install

npm install @sandbx_npm/ace-sdk-browser or yarn add @sandbx_npm/ace-sdk-browser

Use cases

SDK uses umd module declaration. So you can use it such as node module system (commonjs), amd or globally in browser.

Examples:

es6 modules (typescript)

import { createClient, IAceClient } from '@sandbx_npm/ace-sdk-browser';
// ...

this.ace = createClient({
  aceEndpoint: 'http://example.com',
  ownAceEndpoint: 'http://example.com',
  clientId: '<clientId>',
  signInRedirectUri: 'http://example.com/user/login',
  signUpRedirectUri: 'http://example.com/user/signUp'
});

CommonJs

const AceSdk = require('@sandbx_npm/ace-sdk-browser');
// ...

this.ace = AceSdk.createClient({
  aceEndpoint: 'http://example.com',
  ownAceEndpoint: 'http://example.com',
  clientId: '<clientId>',
  signInRedirectUri: 'http://example.com/user/login',
  signUpRedirectUri: 'http://example.com/user/signUp'
});

global

<script src="/ace-sdk.js"></script>
<!-- ... -->
<script>
  window.ace = AceSdk.createClient({
    aceEndpoint: '<%=aceUrl %>',
    ownAceEndpoint: location.origin,
    clientId: '<%=clientId %>',
    signInRedirectUri: location.origin + '/user/login',
    signUpRedirectUri: location.origin + '/user/register',
    localStorageKey: 'ace-tokens'
  });

  window.signUp = function() {
    ace.signUp({ referrer: '<userValidEmail>' });
  };
</script>

Develop

Use yarn run watch or yarn build command for development.

Tests

yarn test

0.0.6

5 years ago

0.0.5

5 years ago

0.0.2

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.1

5 years ago

0.0.1-beta6

5 years ago

0.0.1-beta5

5 years ago

0.0.1-beta4

5 years ago

0.0.1-beta3

5 years ago

0.0.1-beta2

5 years ago

0.0.1-beta1

5 years ago