0.2.3 • Published 2 years ago

@nayotta/mta-wechat-mp v0.2.3

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

mta-wechat-mp

Build & Lint & TestNode.js Package

zh_CN

an unofficial wechat miniprogram resources sdk for javascript/typescript

install

$ npm install @nayotta/mta-wechat-mp

How to use it ?

import { MtaWechatMp } from '@nayotta/mta-wechat-mp'

const mtaWechatMp = new MtaWechatMp({
	appid: 'your_app_id',
	secret: 'your_app_secret',
	cloudEnvs: {
		develop: 'develop_cloud_env_id',
		production: 'production_cloud_env_id'
	},
	// warning: It is not recommended to operate on the client side, optional
	proxy: {
		proxyUrl: 'http://localhost:2333/mp'
	},
	// optional timezone setting
	tz: 'Asia/Shanghai'
})

// cloud
const {
	// database
	db: devDb,
	// cloud function
	func: devFunc,
	// cloud storage
	storage: devStorage
} = mtaWechatMp.clouds.develop

// analysis
mtaWechatMp.analysis.getVisitTrend({
	type: 'daily',
	beginDete: '2021-12-22',
	endDate: '2021-12-22'
}).then(res => {
	console.log(res)
}).catch(err => {
	console.error(err)
})

TODO

  • add documents (Github wiki);

  • more unit tests;

  • add others modules of MtaWechatMp, your PR is welcomed;

0.2.1

2 years ago

0.2.0

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago