0.2.2 • Published 2 years ago

sclabjs v0.2.2

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

SCLABjs

npm package Build Status Downloads Issues Code Coverage Commitizen Friendly Semantic Release

SCLAB client side javascript NPM Module for integrate with a SITE created by SCLAB Studio

Documentation

Install

npm install sclabjs

Usage

import { Sclab } from 'sclabjs';

// client side
Sclab.init("https://userSiteCode.sclab.io", ()=>{
  // ready

  // login
  Sclab.login('abc@sclab.io', '1234', (result: boolean)=>{
    if(result){
      // move to user page
    }else{
      // login error
    }
  });
});

Client APIs

init(siteURL, apiToken?, callback?)

siteURL

Type: string

Published site url of your SITE.

callback

Type: function

callback function when sclabjs ready to use

login(email, password, callback)

email

Type: string

email address

password

Type: string

user password

callback

Type: function

callback function when login complete

loginWithToken(loginToken, callback)

loginToken

Type: string

loginToken from REST API

callback

Type: function

callback function when login complete

logout(callback)

callback

Type: function

callback function when logout complete

kill()

clear Sclab