本文档是@custouch-open/js-sdk的快速使用指南,演示使用的环境版本为Node@20和yarn@1.22.22
"@custouch-open:registry" "https://npm.cnb.cool/custouch/npm/-/packages/"
"registry" "https://registry.npmmirror.com"
yarn add @custouch-open/js-sdk
import { init, CheckAccess } from '@custouch-open/js-sdk'
// 确保只初始化一次
init({ appKey: '{appKey}', jsApiList: [...] }).then(({ wxKit }) => {
// 确保在初始化完成后调用接口方法
CheckAccess().then(res=>{
...
})
})
import { wxKit } from '@custouch-open/js-sdk'
// FAQ: 可以通过`await wxKit.sdkCompleted`来确保wxKit.sdk已经初始化完成
// 调用微信的开始录音接口,当然需要提前声明到jsApiList中
wxKit.sdk.startRecord()
该目录下暴露了所有可供使用的接口,以下不同模块的解释,更具体的解释可以参考相关接口的文档
相关文件的具体使用方法可以参考对应的 readme 文档
yarn add @custouch-open/rich-text-vue3
yarn add @custouch-open/resource-pdf
yarn add @custouch-open/resource-video