Getting Started
This chapter will help you quickly start mini-app development.
Development Preparation
Apply for Developer Application
Before development, you need to apply for a developer application from the official platform. The following information is required:
- Application Name: Typically composed of simple English terms, such as "card", "ota", etc.
- Application Description: A brief description of the Mini-App.
- Application Keywords: Used for quick searching, supporting multiple languages.
After successful application, you will get:
app_key
: Application identifierapp_secret
: Application secret (should be securely stored to prevent leakage)
Development Process
- Mini-App developers work on both frontend and backend projects separately (we provide basic utility libraries for both frontend and backend development, which will be introduced later).
- Developers then use the Mini-App debugger for testing.
- After debugging is complete, the program can be published and launched.
Project Configuration
Integrating the mos.js File in Mini-App Projects
To invoke MOS interfaces, include the following MOS file in your target pages:
html
<script src="https://cdn-oss.mos.me/public/js/mos-1.1.0.js"></script>
SDK Download
Click to download the latest version of SDK: mos-1.1.0.js
Tip
Strong Recommendation: Download the JS File Locally
Vue/React Project Configuration
If you are using it in a Vue or React single-page application, you need to import it in the root file index.html
:
html
<script src="https://cdn-oss.mos.me/public/js/mos-1.1.0.js"></script>
Note
If eslint validation is enabled in the project that variables must be declared before use, you can access the mos object through window.mos
.