Miniapp Login
You can retrieve the app user's identifier through APIs to efficiently set up a miniapp user system.
Login process
Description
- Call
ty.login()to get the temporary login credential code and send the code to your server. - Your server calls the Tuya cloud development API
/1.0/tokenand passes in the code to get theaccess_tokenanduid. Then, you customize the login status based on theaccess_tokenanduidand send it to the frontend for further interaction.
Note: Before developing a miniapp, make sure that the miniapp is already associated with your cloud project. For more information, see Server Development below.
Server development
To call the Tuya cloud development API, you need to create a cloud project and associate it with your miniapp.
-
Go to Tuya Developer Platform > Cloud > Development > Create Cloud Project, and create a cloud project as instructed.
-
After creating a project, open the project overview page and find the Client ID and Client Secret used for signing requests.
-
Go to the Tuya MiniApp Developer Platform. Click
Developmentand thenAddto associate with your cloud project.