@sandbx_npm/ace-sdk-browser
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @sandbx_npm/ace-sdk-browser

Weekly Downloads

0

Version

0.0.6

License

MIT

Unpacked Size

21.5 kB

Total Files

7

Last publish

Collaborators

  • devops_sandbx
  • seyar