@ant-basement/miniprogram-sdk
TypeScript icon, indicating that this package has built-in type declarations

2.2.24 • Public • Published

miniprogram-sdk

NPM

Basement SDK for Alipay Mini Program IDE

Getting Started

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

Documentation

API reference please see documentation

Usage

// 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);
        });
      },
    });
  }
});

/@ant-basement/miniprogram-sdk/

    Package Sidebar

    Install

    npm i @ant-basement/miniprogram-sdk

    Weekly Downloads

    3

    Version

    2.2.24

    License

    MIT

    Unpacked Size

    844 kB

    Total Files

    20

    Last publish

    Collaborators

    • lulin
    • sanglv
    • shouna.ysn
    • zack-lin