Quick start

更新时间:
复制 MD 格式

Set up the Mini Program IDE, create a project, and publish your first mini program.

  1. Download the IDE

  2. Create a mini program

  3. Download the configuration file

  4. Log in to the Mini Program IDE

  5. Select an associated mini program

  6. Edit code

  7. Upload the mini program

  8. Release the mini program

Download the IDE

Download the Mini Program Developer Tools (IDE).

Create a mini program

  1. Open the installed Mini Program IDE. In the left pane, click Mini Program, click + to open the creation page, then click mPaaS and select a template.

    de8c815fa172405753cb3dd16d7d9be9.png

  2. Enter the Project Name, specify the Project Path, and click Finish.

Important
  • For uni-app templates, use Node.js earlier than v18. Newer versions may cause compatibility issues.

  • To install dependencies with yarn:

    1. Open a terminal and navigate to the project root directory.

    2. Run the yarn install command.

    This installs dependencies and starts the development environment.

Download the configuration file

Each time you create an environment, download the corresponding Mini Program IDE configuration file from the console.

  1. In the mPaaS console, navigate to Mini Program > Mini Program Release > Configuration Management. In the IDE Configuration Management section, click Download Configuration File.

    Note

    This IDE configuration file is different from the configuration file for an mPaaS application.

    image.png

  2. In the Download Configuration File dialog box, enter a dynamic password. You will use this password to log in to the IDE.

    Note

    The downloaded configuration file is named config.json by default.

Log in to the Mini Program IDE

Log in to the Mini Program IDE using one of the following methods:

Dynamic password login

  1. In the Mini Program IDE, click Login in the upper-left corner.

  2. If no login environment exists, the Add Environment dialog box appears. Otherwise, the login window appears.

    • For a new login environment: enter an environment name and upload the Mini Program IDE configuration file (config.json) downloaded from the mPaaS console.

      image.png

    • For an existing login environment: click the environment menu at the top, select + Add Environment, enter an environment name, and upload the Mini Program IDE configuration file (config.json) downloaded from the mPaaS console.

      image.png

  3. Click OK to create the new login environment.

  4. In the login window, enter your credentials:

    image.png

Aliyun AccessKey login

Important

To use the Aliyun AccessKey login method, you must upgrade the Mini Program IDE to version 2.9 or later.

  1. In the Alibaba Cloud console, move the pointer over your avatar in the upper-right corner and click AccessKey Management.

    image.png

    Important
    • You can use an Alibaba Cloud account or RAM user AccessKey for API calls.

    • If you use the AccessKey of an Alibaba Cloud account, you must first obtain an AccessKey.

    • RAM user AccessKeys are recommended because they offer more granular permission control.

  2. Click Use AccessKey Pair of RAM user. The following steps use a RAM user AccessKey as an example.

    image.png

  3. Click Create User to open the Create User page.

    image.png

  4. Enter the Logon Name and Display Name, select OpenAPI programmatic access, and then click OK to create the RAM user.

    image.png

  5. Copy and securely store the AccessKey ID and AccessKey Secret. The AccessKey Secret is displayed only once — if lost, you must create a new AccessKey.

  6. In the Actions column for the user, click Add Permissions to open the Add Permissions page.

    image.png

  7. In the permission search box, enter MpaaSFullAccess, select AliyunMpaaSFullAccess, and then click OK. This grants mPaaS permissions to the user.

    image.png

  8. Open the configuration file you downloaded earlier in a text editor, add the following content, and save the file.

    {
     // Original configuration file content,
      "openapi": {
        "type": "aliyun",
        "accessKeyId": "The AccessKey ID generated in Step 5",
        "accessKeySecret": "The AccessKey Secret generated in Step 5",
        "endpoint": "mpaas.cn-hangzhou.aliyuncs.com",
        "userId": "The Logon Name entered in Step 4"
      }
    }

    image.png

  9. In the mPaaS Mini Program IDE, click Login to open the Login window.

    1

  10. Click + Add Environment to open the New Login Environment page.

    2

  11. Enter an Environment Name, upload the configuration file that you updated in Step 8, and then click OK.

    3In the login dialog box, the configuration file type is displayed as Aliyun AccessKey. Click Login to complete the process.

    image.png

Select an associated mini program

After logging in, click Select Associated Mini Program in the upper-left corner and select the mini program you created in the console.

image.png

Edit code

After associating the mini program, edit its code in the IDE.

image.png

Upload the mini program

After editing, click Upload in the upper-right corner to upload the mini program to the mPaaS console.

image.png

Release the mini program

In the mPaaS console, navigate to Mini Program > Mini Program Release. Release a mini program package.