auth-wechat-miniprogram

Expose WeChat Mini Program OPENID and UNIONID to CloudBase cloud functions.

1|Updated Apr 13, 2026
One-click install
npx skills add https://github.com/AYin-Z/class_mansys --skill auth-wechat-miniprogram-ayin-z
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-wechat-miniprogram
Source: https://github.com/AYin-Z/class_mansys/tree/main/.trae/skills/cloudbase/references/auth-wechat
Command: npx skills add https://github.com/AYin-Z/class_mansys --skill auth-wechat-miniprogram-ayin-z

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Native WeChat Mini Program authentication in CloudBase enables seamless identity handling for Mini Programs by exposing OPENID/UNIONID to cloud functions and enabling automatic verification via WeChat.

Core Features & Use Cases

  • Automatic identity propagation: When a Mini Program calls a cloud function, WeChat injects OPENID/APPID/UNIONID for identity-aware processing.
  • Easy initialization: Simple setup to enable CloudBase native authentication across the app.
  • Use cases: Per-user data access, permission checks, and cross-app user identification without manual login.

Quick Start

Initialize CloudBase in your Mini Program and leverage native WeChat identity in cloud functions without explicit login.

Frequently Asked Questions about auth-wechat-miniprogram

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get OPENID and UNIONID for WeChat Mini Program authentication in CloudBase?

WeChat Mini Program authentication in CloudBase exposes OPENID and UNIONID to cloud functions automatically. WeChat injects these identifiers when a Mini Program calls a cloud function, enabling identity-aware processing without manual login.

Can I use cloud.getWXContext to access WeChat Mini Program identity in cloud functions?

Yes, you can use cloud.getWXContext to access WeChat Mini Program identity in cloud functions. This Skill ensures compatibility with cloud.getWXContext to automatically propagate OPENID, APPID, and UNIONID for native authentication.

What is the best way to handle cross-app user identification for WeChat Mini Programs?

Handling cross-app user identification for WeChat Mini Programs is best achieved by exposing UNIONID to cloud functions. This allows multiple Mini Programs under the same WeChat account to identify a unified user identity without explicit login.

Do I need to manually configure login to enable per-user data access in a WeChat Mini Program?

No, you do not need to manually configure login to enable per-user data access. WeChat automatically propagates OPENID and APPID to CloudBase cloud functions upon invocation, allowing seamless identity verification and data authorization.

Does CloudBase native authentication support environment-aware identity handling with cloud.DYNAMIC_CURRENT_ENV?

CloudBase native authentication supports environment-aware identity handling using cloud.DYNAMIC_CURRENT_ENV. This ensures that WeChat OPENID and UNIONID are correctly processed within the corresponding cloud function environment context.