Batch generation cloud development model, is in the existingWeChat Cloud DevelopmentBased on the new model provided by the third party platform scenario. It can provide complete WeChat cloud development support for third-party platforms, and support third-party platforms to uniformly manage cloud environments and resources, call batch development interfaces, etc., and quickly and efficiently realize the release and iteration of Mini programs without authentication. Third-party platforms may be used in accordance with the following process.

# Preparation before development

# Third-Party Platform Application

At present, the batch generation cloud development model supports the use of platform third-party platforms. Please apply first. Please refer to thePlatform-based Third Party Platform Application and Launch Process

# Open batch generation cloud development

Get intoWeChat Open PlatformAfter logging in, under the third-party platform module, select the platform third-party platform to be opened and approved, in the detailed operation, select the cloud development module, click on the opening and agree to the relevant agreement to complete the opening. image.png Support to create a new Tencent cloud account according to the service provider AppID to provide the corresponding resources, you can also choose to bind the existing Tencent cloud account when opening, scan the code to complete the binding after authorization. image.png

# To grant authorization

  1. Third-party platforms need to check in the Mini Program permissions Development Management and Data Analysis Authority
  2. The authorization process can be referred to Authorization Process Technical Notes

# Deauthorization

After the Mini Program is de-authorized, it will not be able to access the cloud development resources of the third-party platform, please perform back-end service migration before de-authorizing.

# Start developing

# 1. Creating a cloud environment

Third party developers, which can be accessed throughCreating an EnvironmentInterface, a pre-created environment for use by subsequent Mini Programs.

# 2. Environment sharing

Third party developers can useEnvironment sharingThe interface shares the created environment that has not been shared with the Mini Program to the client Mini Program for subsequent client Mini Program to call the cloud environment resources.

Note: Cloud development environments created by third-party platforms can only be used for Mini Programs with the client, and the cloud development environments of different client entities are isolated from each other. In addition, cloud development supports cross-account environment (resource) sharing, that is, the cloud development environment resources of a Mini Program can be authorized to share with other Mini programs under the same customer body. / Official Account message template Use. Please refer toEnvironment sharing

# 3. Login to the console to manage your cloud environment

Third-party platforms can be accessed throughEnvironment sharingInterface to share the created cloud environment with the pre-created development Mini Program of the third-party platform. Through the development of Mini Program code login developer tools, cloud environment management operations. Please refer to the application for developing Mini Program.Development Profile Note: The third-party platform can share the environment that has been shared to the customer Mini Program again through the environment sharing interface to the development Mini Program, you can use the development Mini Program to scan the code to log in the developer tool, and manage the shared cloud environment in the cloud development console.

# 4. Development templates

Third-party platform, in the use of development Mini Program landing developer tools, you can carry out the development and release of the code template. Please note that under the vendor cloud development model, all development logic is based onEnvironment sharingPlease refer toGuide to Use, when the resource is invoked, specify the resource side environment ID (that is, the environment ID created by the third-party platform in the above step, which can be used byQuery Environmental InformationGet).

// Statement of the new cloud Example
var c1 = new wx.cloud.Cloud({
  // Resource side AppID
  resourceAppid: 'wxe0e2656d74f0bff3',
  // Resource side environment ID
  resourceEnv: 'test-f96b31',
})

// Call across accounts, have to wait init complete
// init The resource side Mini Program corresponds to the environment of the cloudbase_auth The function is called and needs to return the protocol field (see below) to confirm that access is allowed and that security rules can be customized
await c1.init()

// Normal use of the authorized cloud resources of the resource party after completion
await c1.callFunction({
  name: 'function name',
  data: {},
})

# 5. Common problem

# 1) Account Dxplaination

  • Third-party APPID and Tencent Cloud Account: Third-party APPID is the account ID that hosts the batch cloud development model, and the corresponding and unique Tencent Cloud Account is used to host all cloud resources under this model.

  • Developing Mini programsWith the customer Mini Program: The development Mini Program is a Mini Program account used by a third party to log in to the developer tools for the development template to upload code. A third party can deploy a template that has been developed and uploaded to a customer Mini Program.

# 2) What is the relationship between the cloud environment under the batch cloud development model and the existing cloud environment of the customer Mini Program?

  • Ownership of a cloud environment created by a third party under the bulk cloud development model is owned by the third party through theEnvironment sharingInterface to share the environment to the client Mini Program, and use it in accordance with the environment sharing specification. The cloud environment created by the customer Mini Program originally through the cloud development console belongs to the customer Mini Program, and the cloud environment cannot be used in the batch cloud development mode. If the resource side environment ID is not explicitly specified in the code, the Mini Program back-end resource invokes the original client Mini Program cloud environment resource.

# 3) Does the development of Mini programs require third party authorization?

  • The development of Mini Programs does not require third-party authorization to develop templates for acquired customer Mini Programs and log in to the cloud development console for management.

# 4)Client Mini Program can't log into the cloud development console?

  • If the client Mini Program, at the time of authorization, has grantedCloud Development Management Permissions, you cannot log into the cloud development console.

# 5)Permission Statement?

  • When developing a Mini ProgramExtEnable is set to trueTime: Logging into the cloud development console through the development Mini Program can only manage the cloud environment shared by the service provider to the customer Mini Program.
  • When developing a Mini ProgramExtEnable is set to falseTime: When logging into the cloud development console through the development of a Mini Program, all the cloud environments of the development Mini Program itself can be managed, and the environment of the customer Mini Program cannot be seen.

# 6)Environment sharing completed, but the resource cannot be called?

  • Under the cloud development model of service providers, all development logic is based onEnvironment sharingPlease refer toGuide to Use, when the resource is invoked, specify the resource side environment ID (that is, the environment ID created by the third-party platform in the above step, which can be used byQuery Environmental InformationGet).

# Open interface

The following interfaces are available for development management:
Environmental management
1.Creating an Environment
2.Query Environmental Information
3.Environment sharing
4.Query shared environment ID

Cloud function management
1.Bulk upload cloud function
2.Remove Cloud Functions
3.Get a list of cloud functions
4.Get Trigger
5.Batch Update Trigger

Cloud Managed Management
1.Open cloud hosting
2.New Cloud Hosting Services
3.View List of Cloud Hosting Services
4.Remove Cloud Hosting Services
5.New Cloud Hosting Service Version
6.Batch New Cloud Hosted Version
7.Remove Cloud Hosted Version
8.View the list of cloud hosting versions
9.View Cloud Hosting Version
10.Configure Cloud Hosted Version
11.Distribution flow ratio
12.Batch distribution flow ratio

Database management
1.Query set
2.Increase collection
3.Delete collection
4.Insert record
5.Delete record
6.Update record
7.Query record
8.Increased index
9.Delete index
10.Database import
11.Database export
12.Database import/Export Status Query
13.Database aggregation
14.Access to Database Operations
15.Modify Database Operation Permissions

Memory management
1.Get File Upload Link
2.Get File Download Link
3.Delete file
4.View File List

Static Website Management
1.Opening a static website
2.View Static Website Status
3.Get Static Web Site File List
4.Get Upload Static Website File Link

# Billing Instructions

Under the batch cloud development model, only the billing method of paying by volume is supported, no need to recharge in advance, and only pay for the actual usage. In bulk cloud development mode, there is no free credit. Please refer toPay as you go