---
title: Quick Start
---

{<Block>

  <a href="https://developer.tuya.com/en/miniapp-codelabs/codelabs/project-start/index.html#0">
    To optimize your reading experience, go to Codelabs.
  </a>
</Block>}

## Set up environment

### Prerequisites

- Before building a miniapp, get your Node.js environment ready. Go to the [Node.js](https://nodejs.org/en) website and download the installer.

### Install editor

Before you develop a panel miniapp, download and install the following recommended editors as needed:

- Visual Studio Code (recommended): supports common built-in features, such as formatting and navigation. This editor is subject to a high level of community engagement.
- WebStorm: Highly integrated IDE.
- Sublime Text: a lightweight editor.

### Install app

> If you want to install a specific app version, you can [submit a ticket](https://service.console.tuya.com/8/3/list?source=support_center) on the Tuya Developer Platform to request further support.

**iOS:**

Go to [App Store > SmartLife](https://apps.apple.com/us/app/smart-life-smart-living/id1115101477), or search for `SmartLife` on App Store for iPhones, and download the app.

**Android:**

Go to [Google Play > SmartLife](https://play.google.com/store/apps/details?id=com.tuya.smartlife&hl=en_US), or search for `SmartLife` on app stores for Android, and download the app.

### Install Tuya MiniApp IDE

> Tuya MiniApp IDE can be used to create your miniapp project, and develop, debug, and upload the miniapp.

Go to [Tuya MiniApp IDE](/en/miniapp/devtools/tools/download) and download the latest version.

### Install NVM

> Node.js version manager (NVM) helps you manage multiple Node.js versions. If this is your first installation, set up the environment variable as per the instruction.

1. Open the Terminal.

2. Install the [NVM](https://github.com/nvm-sh/nvm).

   ```shell
   	curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash
   ```

3. Enter `nvm -v` to confirm that NVM is installed as expected. If a version number is returned, the installation is successful. Make sure you are using Node.js v18.0.0 or later. If the error `nvm: command not found` is returned, follow the instructions in FAQs to fix the error.

4. Enter `nvm install 18.20.8` to install Node.js v18.20.8.

5. (Optional) Run the command `nvm use` to switch among Node.js versions. We recommend that you install Node.js v18.20.8 or later.

   ```shell
   	nvm use 18.20.8
   ```

### Install Yarn

> If you have installed Yarn, or used Node.js Package Manager (npm), performant npm (pnpm), or other dependency manager tools, you can skip this section.

1. Open the Terminal.

2. Enter `npm install -g yarn` to install Yarn.

3. (Optional) Enter `yarn -v` to confirm that Yarn is installed as expected.

## Create your Tuya account

[Register an account of the Tuya Developer Platform](https://auth.tuya.com/register?from=https%3A%2F%2Fiot.tuya.com%2Fminiapp%2F).

## Initialize project

You must register an account with the Tuya Developer Platform and use this account to log in to the Tuya MiniApp Developer Platform before you can create a miniapp.

1. Log in to the [Tuya MiniApp Developer Platform](https://iot.tuya.com/miniapp/) to see the page that lists existing miniapps.

2. Click **Create** on this page.

3. Set the name, logo, type, and other required information about the miniapp, and click **OK**.

<Image
  src='/images/guide/quick-start/start/create-project.en-US.png'
  style={{
    borderRadius: '10px',
    boxShadow: '0 0 5px rgba(0,0,0,0.3)',
  }}
/>

## Develop and debug

### Create project and link miniapp

1. Open Tuya MiniApp IDE, log in to it with the account of the Tuya Developer Platform, and then create a miniapp project.
2. Set the **project path**, **project name**, and **associated miniapp** as instructed, and click **OK** to open the project.
3. To link the project with a smart miniapp, you must have the necessary developer permissions on the [Tuya MiniApp Developer Platform](https://iot.tuya.com/miniapp/). Then, when you create or import a miniapp project in Tuya MiniApp IDE, you can link the project with the miniapp created on the **Tuya MiniApp Developer Platform**. This allows you to develop, debug, and upload the code.

<Image
  src='/images/guide/quick-start/start/ide-create-project-US.png'
  style={{
    borderRadius: '10px',
    boxShadow: '0 0 5px rgba(0,0,0,0.3)',
  }}
/>

### Write code

Your project template is automatically initialized in the project path of Tuya MiniApp IDE. You can use the code editor to open the project and start programming.

- For more information about the directory structure and file types of the miniapp, see [Framework](/en/miniapp/develop/miniapp/framework/overview).
- For more information about the basic components of the miniapp, see [Components](/en/miniapp/develop/miniapp/component).

### Preview and debug

During the development in the IDE, you can preview the miniapp with the emulator in the left pane.

The emulator does not support all APIs. Therefore, you must click [Remote Debugger](/en/miniapp/devtools/tools/debug) in the top menu bar to preview and debug the miniapp.

<Image
  src='/images/guide/quick-start/start/remote-debug.png'
  style={{
    borderRadius: '10px',
    boxShadow: '0 0 5px rgba(0,0,0,0.3)',
  }}
/>

### Upload program

At the end of the development, click **Upload** in Tuya MiniApp IDE to upload the local program to the cloud.

The uploaded version will then appear on the [Tuya MiniApp Developer Platform](https://iot.tuya.com/miniapp/).

<Image
  src='/images/guide/quick-start/start/upload-en.png'
  style={{
    borderRadius: '10px',
    boxShadow: '0 0 5px rgba(0,0,0,0.3)',
  }}
/>

<Image
  src='/images/guide/quick-start/start/platform-version.en-US.png'
  style={{
    borderRadius: '10px',
    boxShadow: '0 0 5px rgba(0,0,0,0.3)',
  }}
/>

## Test miniapp

#### Step 1: Install app

The tester must get the app installation package from the app developer to install the app for testing. The app developer must have integrated the miniapp capabilities into the app. The base library version and Kit package version that are bound with the app must be compatible with the miniapp to be tested.

#### Step 2: Add the test account to the miniapp project and allowlist

Go to [Tuya MiniApp Developer Platform > Members](https://iot.tuya.com/miniapp/) and add the test account to the project. Therefore, the tester can access the miniapp project by using this account.

You must also configure the **Distribution** module as required and add the test account to the **allowlist**.

For more information, see [Tuya MiniApp Developer Platform > Trial QR Code](/en/miniapp/common/desc/platform#trial-qr-code).

#### Step 3: Generate trial QR code

1. Go to [Tuya MiniApp Developer Platform > Versions](https://iot.tuya.com/miniapp/), and set the target miniapp version to the trial version.
2. Click **Trial QR Code** for the version.
3. Configure the QR code to enable automatic navigation to a specified page from the miniapp. You can also keep the default settings and click **OK**.
4. Scan the QR code and test the miniapp.

<Image
  src='/images/guide/quick-start/start/set-experience.en-US.png'
  style={{
    borderRadius: '10px',
    boxShadow: '0 0 5px rgba(0,0,0,0.3)',
  }}
/>

<Image
  src='/images/guide/quick-start/start/experience-qrcode.en-US.png'
  style={{
    borderRadius: '10px',
    boxShadow: '0 0 5px rgba(0,0,0,0.3)',
  }}
/>

## Compliance requirements

Your miniapps must meet security compliance requirements. Tuya performs security checks for the target domain names and request paths for the miniapps.

To make the following API requests or load static resources, you must configure respective domain names at [Tuya MiniApp Developer Platform > Development](https://iot.tuya.com/miniapp/). <font style={{color: 'red'}}>Otherwise, an error message might be returned when you make an API request or load static resources.</font>

| Target API        | Configured At                                                                           |
| ----------------- | --------------------------------------------------------------------------------------- |
| ty.request()      | Tuya MiniApp Developer Platform > Development > Server Domain Names Across Data Centers |
| ty.uploadFile()   | Tuya MiniApp Developer Platform > Development > Server Domain Names Across Data Centers |
| ty.downloadFile() | Tuya MiniApp Developer Platform > Development > Server Domain Names Across Data Centers |
| Static resources  | Tuya MiniApp Developer Platform > Development > Static Resources Across Data Centers    |

Add the domain names that are accessible by `ty.request()`, `ty.uploadFile()`, and `ty.downloadFile()` to **Tuya MiniApp Developer Platform** > **Development** > **Server Domain Names Across Data Centers**.

To enable these API requests, the trustable domain names can vary, depending on the different data centers to which your target apps will be distributed. **Note: Do not include the root path `/` in the trustable domain names to be added.**

To view the data centers to which your target apps will be distributed, go to **Tuya MiniApp Developer Platform** > **Distribution**.

<Image
  src="/images/guide/audit/multi-area.en-US.png"
  style={{
    borderRadius: '10px',
    boxShadow: '0 0 5px rgba(0,0,0,0.3)',
  }}
/>

Add the domain names of the static resources specified in the code package of a miniapp to **Tuya MiniApp Developer Platform** > **Development** > **Static Resources Across Data Centers**. These domain names can vary, depending on the different data centers to which your target apps will be distributed.

**Note: Do not include the root path `/` in the trustable domain names to be added.**

<Image
  src="/images/guide/audit/multi-static.en-US.png"
  style={{
    borderRadius: '10px',
    boxShadow: '0 0 5px rgba(0,0,0,0.3)',
  }}
/>

## Submit for review and release

1. Log in to the [Tuya MiniApp Developer Platform](https://iot.tuya.com/miniapp/) and click the target miniapp to go to **Versions**.
2. On the **Dev Versions** tab, find the target version and click **Submit for Review**.
3. Then, this version is moved to the **Review Versions** tab and appears with the review status.
4. The approved version is moved to the **Official Version** tab, where you can start or pause this version. You can click the **Start** button to make this version available to users, or click **Pause** to make it unavailable to users.

| Version type        | Description                                                                                                                                                                                         | Available button                                                                                                                                                        |
| ------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Development version | Each uploaded version is an independent development version.                                                                                                                                        | **Submit for Review**, **Delete**                                                                                                                                       |
| Trial version       | (Optional) Before an official version becomes generally available, you can set this version to a trial version and allow authorized members to test this version.                                   | **Set as trial version**                                                                                                                                                |
| Review version      | A development version is submitted for review and becomes this version. If a version does not pass the review, the version needs to be returned for modification based on the reason for rejection. | Available buttons vary, depending on different review states:<br/> - Reviewing: **Cancel Review**<br/> - Passed: **Request Release**<br/> - Rejected: **Cancel Review** |
| Official version    | The released official version is generally available to all users.                                                                                                                                  | **Start**, **Pause**                                                                                                                                                    |

## Miniapp distribution

- Distribute a miniapp to the specified app to make it available on that app. Go to **Tuya MiniApp Developer Platform** > **Distribution** and add the target app.
- After adding the deployed MiniApp, you need to select the corresponding deployment region. For example, for MiniApp to be deployed in the US region, you need to select the US data center. If none are selected, access will not be available anywhere.
- The distribution step is unnecessary for panel miniapps.
- After distributing a miniapp, configure its entry point on the Tuya Developer Platform. See How to configure tab pages.

<Image
  src="/images/guide/platform/output-manage1.en-US.png"
  style={{
    borderRadius: '10px',
    boxShadow: '0 0 5px rgba(0,0,0,0.3)',
  }}
/>

## Configure custom tab pages

- Tuya offers various features to enhance your app experience. You can configure a miniapp entry point on the **Smart** tab page or customize a tab page with a miniapp.

1. Configure a miniapp entry point on the **Smart** tab page. See [Smart Configuration](https://iot.tuya.com/oem/smartConfig).

   <Image src="/images/guide/overview/guide-entry.en-US.png"/>

2. Customize a tab page.

   Choose your app on the [IoT Development Platform](https://iot.tuya.com/oem/index). Click **Detailed Settings**.

   <Image src="/images/guide/overview/guide-configapp11.en-US.png"/>

   Choose **Page** > **Manage Tab Pages** > **Add Miniapp**.

   <Image src="/images/guide/overview/guide-configapp22.en-US.png"/>

Choose the target miniapp, upload its icon, and set the name. Then, you can configure a miniapp entry point on your custom tab page.

See [more configurations](https://developer.tuya.com/en/docs/iot/smart-life-app-updates?id=Kd4is05osruqn#title-4-OEM%20App%20Customization%20Lite).
