Updated on 2026-07-29 GMT+08:00

How Can I Connect WeChat?

Different from other applets, WeChat supports the following two access methods.

Method 1: Integrating the SDK using npm

  1. Ensure that the project has the package.json file. If it does not exist, run the following command in the root directory of the project to create one:
    npm init
  2. Run the SDK installation command to install the SDK software package:
    npm i apm-mini-sdk
  3. Use the developer tool to build the npm library file of the current project.
  4. Use import agent from 'apm-mini-sdk' in the app.js file.

Method 2: Importing a file

  1. Run the SDK installation command to install the SDK software package:
    npm i apm-mini-sdk
  2. Find the app.js file (node_modules > apm-mini-sdk > app.js) in the SDK folder, copy it from node_module to the root directory, and rename it.