auth-wechat-miniprogram

Authenticate WeChat Mini Program users via CloudBase and retrieve OPENID/UNIONID in cloud functions.

1|Updated Dec 1, 2025
One-click install
npx skills add https://github.com/binggg/GALAXY-VORTEX --skill auth-wechat-miniprogram-binggg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-wechat-miniprogram
Source: https://github.com/binggg/GALAXY-VORTEX/tree/main/.claude/skills/auth-wechat
Command: npx skills add https://github.com/binggg/GALAXY-VORTEX --skill auth-wechat-miniprogram-binggg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide provides a complete approach to implementing WeChat Mini Program authentication with CloudBase, enabling native login, automatic user identity provisioning, and seamless cloud function integration.

Core Features & Use Cases

  • Native WeChat login integration with CloudBase and automatic access to user identity (OPENID, UNIONID) in cloud functions
  • Step-by-step scenarios for initialization, accessing user identity in cloud functions, function-to-MiniProgram calls, and authentication testing
  • Best practices for secure identity handling, environment initialization, and error handling in CloudBase workflows

Quick Start

Initialize CloudBase in your Mini Program and use cloud.getWXContext() inside cloud functions to access the authenticated user identity.

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 in WeChat Mini Program cloud functions?

To get OPENID and UNIONID in WeChat Mini Program cloud functions, initialize CloudBase and use the cloud.getWXContext() method to securely access the authenticated user identity.

What is the best way to implement native WeChat Mini Program login with CloudBase?

Native WeChat Mini Program login with CloudBase is implemented by initializing the environment via wx.cloud in the client and using wx-server-sdk in cloud functions to handle automatic user identity provisioning.

Do I need wx-server-sdk to secure resource access in CloudBase workflows?

Yes, you need wx-server-sdk in cloud functions alongside a properly linked CloudBase environment to authenticate users and securely identify callers for resource access across CloudBase-backed features.

Can I test WeChat Mini Program authentication and identity provisioning locally?

WeChat Mini Program authentication testing is supported by the workflow, allowing you to validate initialization, function-to-MiniProgram calls, and secure identity handling within your CloudBase environment.

Why does my CloudBase initialization fail to retrieve user identity in cloud functions?

CloudBase initialization fails to retrieve user identity when the environment is not properly linked or when wx.cloud is missing in the Mini Program client, preventing secure identity access in cloud functions.