This package has been deprecated

Author message:

The

max-register-sso-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

SSO SDK Documentation

Install

npm install --save sso-sdk-test-publish

Importing

JavaScript (ES3)

var SSO = require('sso-sdk-test-publish');

JavaScript (ES5 or ES6)

const SSO = require('sso-sdk-test-publish');

JavaScript (ES6) / TypeScript

import { SSO } from 'sso-sdk-test-publish';

Constructor

SSO(id : string)

Creates a new SSO

const sso = new SSO('a sample wallet address');

Parameters:

id <string> : a Maxonrow wallet address

Methods

signOn & signUp both returns json objects which can be used to generate QrCode to be scanned with the Max-wallet app.

signOn()

Returns a json object

const a = sso.signOn();

Response:

{
    ac:  string,
    ch:  string,
    id:  string
}

signUp(id : number)

Returns a json object

const a = sso.signUp(1);

Parameters:

id <number> : the package id for which users can sign up to

Response:

{
    ac:  string,
    ch:  string,
    id:  string
    pk: number
}

Events

onConnect

Returns true when connected

sso.onConnect = (connected)=>{
    if(connected){
        /**do something in here**/
    }
}

onSignOn

sso.onSignOn = (data)=>{
    /**do something with data here**/
}

Response:

{
    payload: {
        data:  {
            ac:  string,
            ch:  string,
            id:  string
        }
        timestamp:  number,
        type:  string
    },
    pubKey: {
        type:  string,
        value:  string,
    },
    signature:  string
}

onSignUp

sso.onSignUp = (data)=>{
    /**do something with data here**/
}

Response:

{
    payload: {
        data:  {
            ac:  string,
            ch:  string,
            id:  string
        }
        items:{
            [key]: string | number
        },
        timestamp:  number,
        type:  string
    },
    pubKey: {
        type:  string,
        value:  string,
    },
    signature:  string
}

onError

sso.onError = (error)=>{
    /**do something with error here**/
}

Readme

Keywords

none

Package Sidebar

Install

npm i max-register-sso-sdk

Weekly Downloads

1

Version

0.0.2

License

ISC

Unpacked Size

19.1 kB

Total Files

14

Last publish

Collaborators

  • chanmohlun