Publish MicroApp

Last Updated on : 2024-06-14 07:23:07download

Overview

  1. You can use the sdf-cli tool to build, package, and deploy a microapp in the root directory of your project, and then push the microapp to the SaaS development platform.
  2. You can further maintain and manage your microapps on the SaaS development platform. After a microapp version is bound with a label, you can activate and use the respective microapp in your SaaS.

Procedure

1. Install CLI

# If you use yarn
sudo yarn global add @tuya-sat/sdf-cli

# If you use npm
sudo npm i -g @tuya-sat/sdf-cli

2. Configure App Key and Secret Key

# Enter developer App Key and Secret Key in sequence.
sdf config

Go to the Tuya Developer Platform and click View Development Credentials in the top right corner of the microapp list to get the App Key and Secret Key.

3. Build and publish microapp

# If you use yarn
yarn build

# If you use npm
npm run build

After the build is successful, run the following command:

sdf publish

4. Publish a label

  1. After the microapp is launched in local mode, you can go to SaaS Development > MicroApp Dev to see the newly launched microapp.
  2. Click Manage and go to Labels.
  3. Click Add Label, enter the label name, and then bind the label with the target version. For more information, see MicroApp Version Labels.