Skip to content
This repository has been archived by the owner on Jun 13, 2022. It is now read-only.

lay2dev/unipass-v2-js-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unipass-js-sdk

中文文档

install

yarn add unipass-js-sdk
// or
npm install unipass-js-sdk --save

introduce

import unipass from 'unipass-js-sdk'

Documentation: https://unipass.gitbook.io/docs/dev-info/connect-unipass

Demonstration: https://t.unipass.xyz/demo

Example

init

unipass.init('https://t.unipass.xyz', (ret) => {
  console.log('unipass_ret', ret)
  // Example: Processing login return values
  if (ret.info === 'login success') {
    this.provider = ret.data
  }
})
// After init, you can read the account in the local cache
this.provider = unipass.provider

login

  • The return value is in the init callback function

Page Jump mode

unipass.login()

Page pop-up mode

unipass.popupLogin()

sign

  • You must sign in before you can sign
  • The return value is in the init callback function

Page Jump mode

unipass.sign({ message: 'demo' })

Page pop-up mode

unipass.popupSign({ message: 'demo' })

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published