Hello World
Cloud Development enables quick building of web websites and Mini Programs, easily achieving multi-end synchronization and helping developers easily enable their cloud development journey.
Scale-out work mode
When you use this scale-out extension:
- Cloud Function renders web pages.
 - web pages and Mini Programs listen for changes in page content input and synchronize.
 
Prerequisites
Have activated Cloud Development.
Install Extension
! WeChat Mini Program developers, please use [Other Login Methods] - [WeChat Official Account Login] to log in, then select the associated Mini Program account to log in; QQ Mini Program developers can directly log in via the [Cloud Development] button in the QQ Mini Program Developer IDE, or log in via the associated Tencent Cloud account.
You can install and manage extensions via the Tencent Cloud Development Console.
Use Extension
- Go to the Cloud Development Console, click on the environment where you need to install the extension (hereinafter referred to as 
custom_envfor the corresponding environment ID), click on the Environment Settings page in the left menu bar to go to the Environment Settings page: 
1.1 Click [Login Methods], turn on the [Anonymous Login] switch to allow anonymous login access to Cloud Development in the application;

1.2 Click [Security Configuration], click [Add Domain] under WEB Security Domain, add the default domain name for HTTP-triggered cloud functions in the current environment: \${custom_env}.service.tcloudbase.com (This domain is assigned by Cloud Development for developers to trigger cloud functions via HTTP. For details, refer to HTTP Trigger), allowing calls to web Cloud Development on pages under this domain.

1.3 Access [Security Configuration], then register
touristappidin [Mobile Application Security Sources]. After successful addition, obtain credential information for later use;
- Open the [Database] under the custom_env environment, find the 
tcb_hello_worldcollection and go to its details. Go to the [Permission Settings] tab, click [Switch to Security Rules], and enter: 
- Open the [Database] under the custom_env environment, find the 
 
{
  "read": true,
  "write": true
}
- web website: Access 
https://${custom_env}.service.tcloudbase.com/tcb_hello_worldvia a browser; 4. WeChat Mini Program: Visit Hello World to obtain the code snippet, one-click import the code into the WeChat Developer IDE (do not configureAppID); In the projectapp.js, update the configuration as follows: 
const cloud = tcb.init({
  env: env: "${custom_env}", // The ID of the current environment
  appSign: "touristappid",
  appSecret: {
    appAccessKeyId: appAccessKeyId: "Mobile Application Security Sources version", // Mobile Application Security Sources version obtained in step 1.3
    appAccessKey: appAccessKey: "Mobile Application Security Sources credentials" // Mobile Application Security Sources credentials obtained in step 1.3
  }
});
- Drag the number in the web or Mini Program to observe the same change on the other end.
 
! This extension is a sample Demo. Please follow the usage instructions to complete the configuration. When registering security sources, use
touristappid; when experiencing it in the Mini Program, there is no need to configureAppID—simply enter the version and credential information corresponding totouristappid.
Other
Scale-out Configuration Information
You can configure the following parameters:
- Environment ID: Select the environment to deploy in.
 
Billing
This extension uses other Cloud Development or other Tencent Cloud services, which may incur relevant fees:
- Cloud Function (Product Pricing and Usage Details).
 - Database (Product Pricing and Usage Details).
 
When using Cloud Development extensions, you pay only for the cloud resources you consume; Cloud Development is billed separately from other cloud resources. You can view details in the Billing Center.
Created Resources
- Type: Cloud Function Description: Utilizes the Cloud Development http service capability to render web pages, enabling developers to experience Cloud Development capabilities.
 - Type: Cloud DB Description: Stores user operation data, utilizes the real-time database capability to monitor data changes, and achieves multi-end data synchronization.
 
Permission Granting
Master Account
This extension capability can be accomplished using Cloud Development's own resources alone, and no additional permissions need to be granted.
Sub-account
If you want sub-accounts to also use this extension, you need to grant the following permissions to the sub-accounts:
- Policy: QcloudAccessForTCBRole Description: Access permissions to cloud resources for Cloud Development (TCB).