What problem does it solve?
It solves the challenge of correctly handling WeChat Mini Program authentication in a CloudBase project so you can reliably identify the signed-in user without building complex OAuth login flows.
Core Features & Use Cases
- Automatic identity injection: retrieves verified
OPENID, APPID, and optionally UNIONID when a mini program calls a cloud function.
- Cloud function identity access: uses
wx-server-sdk with cloud.getWXContext() to implement user-specific logic securely.
- Mini program initialization: initializes CloudBase early in the mini program lifecycle via
wx.cloud.init() to ensure auth behavior works as expected.
Use case example: a mini program calls a CloudBase cloud function to fetch user-specific navigation routes; the function uses OPENID from cloud.getWXContext() to query and return only that user's data.
Quick Start
Use this skill to implement mini program identity handling by initializing CloudBase in app.js and reading the caller identity in the target cloud function with cloud.getWXContext().