# @ant-basement/miniprogram-sdk

> Ant Basement JavaScript SDK for Alipay MiniProgram

Latest version **2.2.24** (published 2019-06-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ant-basement/miniprogram-sdk
pnpm add @ant-basement/miniprogram-sdk
yarn add @ant-basement/miniprogram-sdk
bun add @ant-basement/miniprogram-sdk
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.24 |
| Published | 2019-06-27 |
| First published | 2018-09-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8.0.0 |
| Dependencies | 2 |
| Unpacked size | 824 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | zack-lin |
| Maintainers | lulin, sanglv, shouna.ysn, zack-lin |

## Links

- npm: https://www.npmjs.com/package/@ant-basement/miniprogram-sdk
- npm.io page: https://npm.io/package/@ant-basement/miniprogram-sdk

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^1.9.3
- [crypto-js](https://npm.io/package/crypto-js.md) ^3.1.9-1

## Recent versions

- 2.2.24 (latest) — 2019-06-27
- 2.2.23-alpha.0 (next) — 2019-06-27
- 2.2.23 — 2019-06-27
- 2.2.22 — 2019-06-26
- 2.2.21-alpha.0 — 2019-06-26
- 2.2.21 — 2019-06-18
- 2.2.20-alpha.6 — 2019-06-18
- 2.2.20-alpha.5 — 2019-06-18
- 2.2.20-alpha.4 — 2019-06-18
- 2.2.20-alpha.3 — 2019-06-18
- 2.2.20-alpha.2 — 2019-06-18
- 2.2.20-alpha.1 — 2019-06-18
- 2.2.20 — 2019-06-18
- 2.2.20-alpha.0 — 2019-06-18
- 2.2.19 — 2019-06-12
- … 76 more at https://npm.io/package/@ant-basement/miniprogram-sdk/versions

## README

# miniprogram-sdk

[![NPM](https://nodei.co/npm/@ant-basement/miniprogram-sdk.png)](https://nodei.co/npm/@ant-basement/miniprogram-sdk/)

Basement SDK for Alipay Mini Program IDE

## Getting Started

> npm install --save @ant-basement/miniprogram-sdk

## Documentation

[API reference please see documentation](https://tech.antfin.com/products/BASEMENT)

## Usage

```js
// app.js
App({
  onLaunch(options) {
    basement.user.getInfo().then(res => {
      console.log('user info', res);
    });
    basement.db.collection('task').find().then(res => {
      console.log('task list', res.result);
    });
    basement.function.invoke('sayHello', { name: 'angela' }).then(res => {
      console.log(res.result + ' says angela');
    });

    basement.appService.invoke('myApp', { method: 'GET' }).then(res => {
      console.log(res.result + 'userId say hello to angela');
    });

    my.chooseImage({
      chooseImage: 1,
      success: res => {
        const path = res.apFilePaths[0];
        const options = {
          env: 'public',
          filePath: path,
        };

        basement.file.uploadFile(options).then(res => {
          console.log('file info', res);
        });
      },
    });
  }
});
```

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