Building a high-performance Mini App inside TikTok isn’t just about standard web development; it requires mastering the specific environment constraints and tools provided by ByteDance. In this technical deep dive, we explore the TikTok Developer CLI (ttdx), critical configuration files, and the strict audit rules you must follow to launch successfully.
1. Mastering the CLI (ttdx)
The bridge between your local development environment and the TikTok ecosystem is the TikTok Minis CLI.
Installation & Initialization
Before you write a line of code, you need the toolkit.
# Install globally via NPM
npm install @tiktok-minis/cli@latest -g
# Initialize a new project configuration
ttdx minis initThe Build Process
Unlike a standard React or Vue build, TikTok Minis requires a specific packaging structure.
# Generate production-ready assets
ttdx minis build:afterWhy this matters: The build:after command ensures your project structure aligns with the platform's requirements, specifically generating the necessary dependency files for the TikTok container to read.
2. The Brain: minis.config.json
Every Mini App requires a minis.config.json file in the root directory. This controls the app's behavior within the TikTok container.
Key Configuration Parameters:
- Navigation Bar: You must define how the top bar looks in both Light and Dark modes.
"navbar": {
"lightModeBgColor": "#ffffff",
"darkModeBgColor": "#000000"
}- Safe Domains: This is critical for security. You must whitelist your backend API domains in the
allowList.
"domain": {
"allowList": ["https://api.yourdomain.com"]
}3. Platform Constraints & Performance
To ensure a smooth user experience, TikTok enforces strict technical limitations. Ignoring these will result in an immediate rejection during the audit phase.
The 50MB Limit
Constraint: Your final ZIP package must be under 50MB.
Solution: Optimize your assets! Use modern image formats (WebP), minify your JavaScript, and load heavy assets (like large videos) from your CDN rather than bundling them in the package.
Forbidden APIs
Because your app runs inside the TikTok host app, certain web capabilities are restricted for security and performance:
- ❌ No eval() or new Function(): Dynamic code execution is blocked to prevent security vulnerabilities.
- ❌ No iframe: You cannot embed external sites within your Mini App.
- ❌ Restricted DOM APIs: Some standard browser APIs (like clipboard or location) require specific SDK bridges.
4. Navigating the Audit: Common Pitfalls
Getting your code to run is half the battle; getting it approved is the other half. Based on the Publication Stage guidelines, here are the most common reasons for rejection:
- Watermarks: Your content must NOT contain watermarks from other platforms or tools.
- Test Accounts: If your app requires a login, you must provide a test account and password in the review notes.
- Privacy Policy: The link provided must be accessible and clearly state how you handle user data (OpenID, etc.).
Conclusion
Developing for TikTok Minis is a powerful way to reach millions, but it demands technical discipline. By adhering to the 50MB limit and correctly configuring your minis.config.json, you ensure your app flies through the review process.
Ready to launch? Head to the TikTok Developer Portal and submit your first build today!
Frequently Asked Questions about TikTok Minis Development
How do I install the TikTok Minis CLI?
Use the command npm install @tiktok-minis/cli@latest -g to install the ttdx tool globally.
What happens if my package exceeds 50MB?
The platform will block the upload. To reduce size, offload large assets (videos, high-res images) to an external CDN and whitelist those domains in your minis.config.json.
Can I use external iframes in my Mini App?
No, the use of <iframe> is strictly forbidden within the TikTok Mini App environment for security and performance reasons.












