# unipass-js-sdk

> unipass-js-sdk

Latest version **1.0.7** (published 2021-09-06) · lay2dev license · 0 weekly downloads

## Install

```sh
npm install unipass-js-sdk
pnpm add unipass-js-sdk
yarn add unipass-js-sdk
bun add unipass-js-sdk
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2021-09-06 |
| First published | 2021-09-03 |
| Weekly downloads | 0 |
| License | lay2dev |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 15.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | lay2dev |
| Maintainers | bigsea-cc |
| Keywords | unipass, unipass-js-sdk, lay2dev |

## Links

- npm: https://www.npmjs.com/package/unipass-js-sdk
- Repository: https://github.com/lay2dev/unipass-js-sdk
- Homepage: https://github.com/lay2dev/unipass-js-sdk#readme
- Issues: https://github.com/lay2dev/unipass-js-sdk/issues
- npm.io page: https://npm.io/package/unipass-js-sdk

## Dependencies (3)

- [crypto](https://npm.io/package/crypto.md) ^1.0.1
- [typescript](https://npm.io/package/typescript.md) ^4.4.2
- [@types/node](https://npm.io/package/@types/node.md) ^16.7.10

## Recent versions

- 1.0.7 (latest) — 2021-09-06
- 1.0.5 — 2021-09-06
- 1.0.4 — 2021-09-03
- 1.0.2 — 2021-09-03
- 1.0.1 — 2021-09-03
- 1.0.0 — 2021-09-03

## README

# unipass-js-sdk

[中文文档](README.zh.md)

install

```
yarn add unipass-js-sdk
// or
npm install unipass-js-sdk --save
```

introduce

```js
import unipass from 'unipass-js-sdk'
```

Documentation: https://unipass.gitbook.io/docs/dev-info/connect-unipass

Demonstration: https://t.unipass.xyz/demo

Example

### init

```js
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

```js
unipass.login()
```

Page pop-up mode

```js
unipass.popupLogin()
```

### sign

- You must sign in before you can sign
- The return value is in the init callback function

Page Jump mode

```js
unipass.sign({ message: 'demo' })
```

Page pop-up mode

```js
unipass.popupSign({ message: 'demo' })
```

---
_Source: https://npm.io/package/unipass-js-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
