Skip to main content

Mini Program Quick Start

Through this guide, you will learn how to use cloud development in mini programs, including core features such as cloud database, cloud storage, and cloud functions.

📱 WeChat Mini Program

📋 Preparations

Before you begin, ensure you have completed the following preparations:

  1. Development Tools: Download and install WeChat Developer Tools
  2. Mini Program Account: Register a WeChat Mini Program, obtain the mini-program's AppID
  3. Base Library Version: Ensure the mini-program base library version is ≥ 2.2.3

🚀 Step 1: Create a Mini Program Project

  1. Open WeChat Developer Tools and log in by scanning the QR code with WeChat

  2. Create New Mini Program Project: Enter your mini-program AppID

    • Select the project storage directory
    • Important: Select WeChat Cloud Development for the backend service
    • Check to agree to the "Cloud Development Terms of Service"
  3. Select Template: It is recommended to select the "Cloud Development QuickStart" template

☁️ Step 2: Activate Cloud Development Environment

Follow the steps to Activate Cloud Development Environment

💻 Step 3: Initialize CloudBase

Initialize CloudBase in app.js:

// app.js
App({
onLaunch() {
// Initialize CloudBase
if (!wx.cloud) {
console.error('Please use base library version 2.2.3 or above to enable cloud capabilities');
} else {
wx.cloud.init({
env: 'your-env-id', // Replace with your Environment ID
traceUser: true,
});
}
}
});

🎯 Step 4: Experience CloudBase features

After creating the project, you can experience the following features:

  • Cloud Database: Click the "Database" button to experience CRUD operations.
  • Cloud Storage: Click the "Storage" button to experience file upload and download.
  • Cloud Function: Click the "Cloud Function" button to experience server-side logic invocation.

📚 Deep Dive

🎮 QQ Mini Program

📋 Preparations

  1. Development Tools: Download and install QQ Mini Program Developer Tools
  2. QQ Mini Program Account: Register a QQ Mini Program developer account
  3. Tencent Cloud account: Must be bound to a Tencent Cloud account.

🚀 Quick Start

  1. Create Project:

    • Open QQ Mini Program Developer Tools
    • Create a new Mini Program project
    • Select Cloud Development Template
  2. Enable CloudBase:

    • Access the CloudBase Console via QQ Mini Program IDE
    • Follow the prompts to enable the CloudBase environment
  3. Account Binding:

    • The system will automatically guide you to complete the binding between your QQ Mini Program account and Tencent Cloud account.
    • After binding, you can utilize the full capabilities of CloudBase.

📚 Learning Resources

Account Binding Note

To facilitate developers using CloudBase in QQ Mini Programs, the system automatically establishes the following binding relationships:

  • Create the identity provider "TcbSamlProvider_qq" in Identity Provider
  • Create the role "TcbSamlRole_qq" in Role

Important: The above information is essential for using CloudBase in QQ Mini Programs. Please do not delete it.

Example Project

Development Tools

Learning Documentation


🎉 Start your Mini Program CloudBase journey! Choose the platform that suits you to quickly build powerful mini program applications.