Overview
🌟 Encountering Cloud Development issues? Click here to consult Cloud Development Copilot, ready to answer your questions at any time. 📱 WeChat Cloud Development users, please choose the Mini Program Official Account to log in.
CloudBase User Guide
1. Differences Between Mini Program·CloudBase and Tencent Cloud·CloudBase
1. Cloud Development CloudBase
CloudBase is a concept that describes all capabilities of the entire ecosystem, outlining features and the product matrix from a platform perspective.
Under the Cloud Development CloudBase concept, there are two instance products: WeChat Cloud Development and Tencent Cloud Cloud Development.
2. WeChat Cloud Development
WeChat Cloud Development (formerly Mini Program Cloud Development) is jointly developed with the WeChat team, offering exceptional cloud-native integration within the WeChat ecosystem. Features like cloud invocations, WeChat Pay, and authentication-free access to WeChat-side information demonstrate enhancements provided by the WeChat team.
The hallmark of WeChat Cloud Development is that it is created under a Mini Program via the Developer Tools console. During creation, a Tencent Cloud account is registered using a WeChat Official Account (Mini Programs are a type of Official Account). Alternatively, you can choose to bind an existing Tencent Cloud account during creation, which avoids creating a new account.
Developers can access the Tencent Cloud official console via WeChat authorization. In the Tencent Cloud Cloud Development console, you can still operate the Cloud Development environment.
New capabilities introduced by Cloud Development will be visually reflected in the Tencent Cloud official console. Certain features (such as Cloud Function HTTP access service) require review and integration by the WeChat team before they can be implemented in the Developer Tools console.
Therefore, it is not that WeChat Cloud Development lacks certain capabilities, but rather that they are not reflected in the console. Thus, it can be concluded that WeChat Cloud Development can still handle multi-end development such as WEB, and it excels in the WeChat ecosystem.
3. Tencent Cloud Cloud Development
Tencent Cloud Cloud Development is a standalone instance product that can be created directly in the Tencent Cloud official console without requiring ownership of a WeChat Mini Program. It is also the environment where CloudBase capabilities are first implemented.
Generally, when we say Cloud Development supports certain capabilities, we are primarily referring to Tencent Cloud Cloud Development (specific officially supported features for Mini Program Cloud Development require review and integration with the WeChat team).
Tencent Cloud Cloud Development also excels in multi-end support. Currently, authentication-free integrations with other Mini Programs are initiated from the Tencent Cloud Cloud Development side. For example, QQ Mini Program only supports Tencent Cloud Cloud Development and does not support WeChat Cloud Development.
Therefore, when developing multi-end applications that are not heavily reliant on the WeChat ecosystem, it is recommended to use Tencent Cloud Cloud Development.
Currently, we have collaborated with multiple frameworks, and all Cloud Development environments enabled through these frameworks belong to Tencent Cloud Cloud Development.
II. Cloud Development SDK and Capabilities
1. WeChat Cloud Development for WeChat Mini Programs
If you are using WeChat Cloud Development, develop WeChat Mini Programs! It is recommended to use wx.cloud on the Mini Program side and wx-server-sdk on the Cloud Functions side. The documentation is all available in the WeChat Official Documentation
2. Tencent Cloud Cloud Development for WeChat Mini Programs
If you want to use Tencent Cloud Cloud Development to develop WeChat Mini Programs, there are two optional ways:
- Your Tencent Cloud Cloud Development environment is bound to the target Mini Program via your Tencent Cloud account. You can directly switch environments in the Tencent Cloud console; for details, refer to the documentation. After switching, you can use wx.cloud in the Mini Program to access this environment, but you cannot manage it in the Cloud Development console of the Mini Program developer tools.
- If your Tencent Cloud Cloud Development environment's associated Tencent Cloud account is not bound to the target Mini Program, it is recommended to use as follows: On the Mini Program side, use the JS-SDK. This SDK has integrated WeChat Mini Program adapter support and can be used directly. You need to configure the mobile security origin (the application identifier should be filled with the Mini Program appid). The usage code is as follows:

Not using the WeChat-side SDK means forfeiting the benefit of WeChat's authentication exemption, requiring you to independently set up an openid system. Unless you are developing multi-end applications, it is not recommended to do so.
Use the Node-SDK on the cloud function side. It can be used directly without adding key or other credential information.
3. Tencent Cloud Cloud Development for QQ Mini Programs
On the Mini Program side, use qq.cloud, which offers a user experience consistent with WeChat Mini Programs.
On the cloud function side, use the qq-server-sdk, which offers a user experience consistent with WeChat. For specific differences, refer to the documentation.
When developing QQ Mini Programs, there is a process of binding a Tencent Cloud account. This binding specifically refers to the Cloud Development environment on the Tencent Cloud side. Even if your bound Tencent Cloud account contains a WeChat Cloud Development environment, it does not support QQ Mini Program development.
In other words, QQ Mini Programs only support Tencent Cloud Cloud Development environments.
4. WeChat Cloud Development for Official Account Web Pages
WeChat Cloud Development can utilize environment sharing capabilities to share environments with Official Accounts. Specifically, Official Account web pages can achieve native login, and cloud functions can invoke Official Account server capabilities with authentication-free invocation.
For details on environment sharing, refer to the official documentation. The official example for Official Account web login is available here. Additionally, you need to write the cloud function cloudbase_auth.
There is a simple DEMO to help you get started quickly. The DEMO includes a pre-packaged login module that can be modified as needed.
Mini Program Cloud Development natively supports only Official Accounts with web authorization capability. Currently, only verified service accounts are supported; other types of Official Accounts are not currently supported, and sharing environments does not provide substantial benefits.
Additionally, Mini Program Cloud Development static website hosting for non-individual entities can directly open any Mini Program without config. For specific implementation documentation, refer to the official example.
Finally, you can use WeChat Cloud Development to enable Official Accounts to receive messages, passively reply to messages, and send template messages. For specific usage, refer to the WeChat official documentation.
If you want to implement Official Account messaging and template sending capabilities yourself, refer to the Cloud Development Official Account Sample DEMO.
5. Developing Standard WEB and Mobile Applications with Cloud Development
Both Tencent Cloud Cloud Development and WeChat Cloud Development support the development of standard WEB and other applications.
For WEB development or JS-based application development, you can basically use the JS-SDK. For specific language and framework requirements, you can directly build using the http api.
For cloud functions, the Node-SDK is primarily used. For more advanced requirements such as batch management, use the manage-sdk. If specific features are missing, send requests directly to Cloudbase@tencent.com, and we will promptly evaluate them.
We welcome contributions to the SDK. If you have an SDK contribution, please send the github repository link and a description to Cloudbase@tencent.com. After review, we will include it and add you to our Evangelist Program to convert contributions into points.
3. Cloud Development Billing Information
In the Mini Program console, you can see two types of billing: Tencent Cloud billing and WeChat-side billing. Tencent Cloud billing is further divided into monthly/yearly subscriptions and pay-as-you-go.
Here, Tencent Cloud billing refers to the deduction from the Tencent Cloud account balance after authorizing login to the Tencent Cloud official website through WeChat. WeChat-side billing, however, involves deduction through scanning the WeChat Pay QR code.
Additionally, pay-as-you-go billing must be processed through Tencent Cloud. Although each Mini Program has two free quotas, exceeding these limits requires recharging your Tencent Cloud account to ensure sufficient balance. Otherwise, service suspension may occur.
You can bind your WeChat Official Accounts Platform (Mini Program-side Tencent Cloud account) in your primary Tencent Cloud account profile, then utilize the primary Tencent Cloud account balance.
4. About Cloud Development Issues
(1) Can cloud invocation be used in any "WeChat Cloud Development" environment?
To use cloud invocation in WeChat Cloud Functions, three conditions must be met:
- Cloud functions in either the "WeChat Cloud Development" environment or the converted "Tencent Cloud Development" environment
- Cloud functions must use wx-server-sdk (other libraries are not supported)
- Certain cloud invocation APIs must be invoked by authenticated users (e.g., Mini Program codes)
Using cloud invocation in WeChat Cloud Run requires meeting one condition:
- The environment to which the WeChat Cloud Run belongs must be part of or shared with the target Mini Program.
Strictly speaking, cloud invocation in Cloud Run provides tokens for server-side calls without requiring developers to manage them. Therefore, developers can directly call server-side APIs or use the encapsulated services officially provided by Cloud Run.
(2) What are the differences and connections between Cloud Hosting (rebranded as WeChat Cloud Hosting) and Cloud Development?
Previously, the difference between cloud hosting in WeChat Cloud Development and WeChat Cloud Hosting, besides the brand upgrade, includes the introduction of an independent console and the upgrade of the original container engine to a comprehensive backend project hosting solution. From code management to CI/CD pipeline deployment and release, it provides an end-to-end, low-cost, enterprise-grade cloud-native solution with more powerful features and a more user-friendly experience.
To summarize, both "WeChat Cloud Development" and "WeChat Cloud Hosting" are components of the WeChat Cloud Service ecosystem jointly developed by WeChat and Tencent Cloud. Both offer serverless and Ops-free capabilities. Cloud Development primarily targets full-stack development scenarios, making it ideal for individual developers, while Cloud Hosting focuses on decoupled frontend-backend architectures, supporting any language or framework, and is more suited for team collaboration and enterprise-grade applications. The two services can also be used in combination.
Here are some DEMO introductory sample projects for everyone to learn:
(3) Are there any examples related to WeChat Pay in Mini Program Cloud Development?
Please refer to the WeChat Pay demonstration DEMO
Cloud Development also provides a Profit Sharing Service. If needed, you can submit an application.
5. Update Notes
- Update time: July 7, 2021
- Update description: Will be updated periodically based on the evolution of Cloud Development
- If the above content still does not provide a solution, it is recommended to ask in the community:
- Related to Tencent Cloud Development: Tencent Rabbit Nest (Preferred choice for Cloud Development capability-related matters)
- Related to WeChat Cloud Development: WeChat Open Community (Ask all WeChat-related questions here.)
- Related to WeChat Cloud Hosting: WeChat Open Community (Ask all Cloud Hosting-related questions here.)
- Follow the "Tencent Cloud Cloud Development" official account, reply with the keyword "join group" to join the official communication groups for various product capabilities