Text of developers.tiktok.com › docs › en › mini-games-technical-overview as Styx crawled it on Nov 18, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Mini Games Technical Overview | TikTok for Developers

Last updated October 5, 2026 Understand how mini games work Key terms Code execution Frames and events Runtime constraints Developing your mini game Cocos Creator LayaAir Unity Debugging your mini game Releasing your mini game Discovering your mini game on TikTok Paid traffic Organic traffic Launching a mini game session Launch types Launch parameters Asset loading Mini Games Technical Overview Mini games on TikTok run inside the TikTok app and are not distributed as standalone apps through an app store.

The code package contains the game and engine code. The runtime loads and schedules that code. The TikTok app performs rendering, audio, input, file, and network operations. You can build your game in Cocos Creator, LayaAir, or Unity, then publish it as a code package. For more information on mini game app registration, account eligibility, and platform features such as login, advertisement, and purchases, see the corresponding integration guides.

Important : Do not use HTML to build mini games. A regular web build, an unadapted Unity WebGL build, or a native app package cannot be delivered directly as a mini game code package. # Understand how mini games work Every time a mini game session launches, it begins from a specific user entry point. The TikTok app selects an available version and obtains its code package. The runtime creates a game instance and executes JavaScript or WebAssembly.

The TikTok app then returns input and asynchronous results to that instance. The code package, runtime, and TikTok app have different responsibilities, so check them separately when troubleshooting. # Key terms Source project : The project in which you maintain scripts, scenes, assets, and engine settings. Make game logic and asset changes here. Code package : The directory delivered to DevTool and the release process after being built, which contains entry points, configurations, JavaScript or WebAssembly, adaptation or bridge code, and bundled resources.

Both debugging and release operations are performed targeting the code package. Runtime : The environment built into the TikTok app that is responsible for loading code packages, creating game instances, executing JavaScript/WebAssembly, and scheduling frames, scheduled tasks, input events and asynchronous results. Engine runtime code : The code provided by Cocos Creator, LayaAir or Unity for scenes, scripts, animations and rendering that is delivered along with the code package.

It is not a runtime built into the TikTok app. TikTok app : The user version of the TikTok app that hosts the runtime and leverages device capabilities to handle rendering, audio, input, file, and network operations. Mini games cannot directly access or manipulate device resources without going through the TikTok app. Developer server : An independently deployed game backend that provides business data such as sessions, save files, and leaderboards.

It is not included in the code package, and the game's network requests are sent by the TikTok app. DevTool : A debugging and testing tool from TikTok's developer platform that connects the local code package with the TikTok app, enabling functions including log and network request viewing, remote debugging, real-device preview, code pre-check and upload. # Code execution When a mini game session is launched, the TikTok app selects the current available version, reuses cached content or downloads missing content, then validates and mounts the code package.

The runtime reads the entry and configuration, creates a game instance, prepares a JavaScript or JavaScript plus WebAssembly environment, and injects public APIs. The entry code then starts the engine code and game logic. Cocos Creator and LayaAir primarily execute JavaScript. Unity C# is converted to WebAssembly during the build. The runtime executes WebAssembly, while JavaScript bridge code connects it to public APIs.

The two paths differ only in code form. Rendering, audio, input, file, and network operations are ultimately performed by the TikTok app. JavaScript and WebAssembly can call only public runtime APIs. The runtime passes each call to the TikTok app and returns the result or error to the active game instance. Requests to the developer server and their responses also pass through the TikTok app. # Frames and events Input events do not trigger the frame loop: the two paths are independent.

The TikTok app sends touch, keyboard, and device events to the active game instance, while the runtime continues to invoke frame callbacks on schedule. On each frame, game code updates scripts, animation, physics, and scene state, then submits draw operations. The TikTok app composes the frame using device graphics capabilities. Network requests use a separate asynchronous path. After the game calls a network API, the runtime passes the request to the TikTok app.

The app checks request rules and accesses the developer server. The app returns the response to the runtime, which triggers a callback or promise result. Waiting for a network response does not stop the frame loop. # Runtime constraints The mini game execution environment is not a full browser : Engine builds can use compatible mini game entries and public APIs, but they cannot depend on full DOM, CSS, web navigation, or arbitrary browser APIs.

Device operations must use public APIs : The TikTok app performs rendering, audio, input, file, network, and lifecycle operations. A game cannot directly access private app interfaces or unavailable device capabilities. Callbacks share JavaScript execution time : Frame callbacks, timers, and app events execute in the active instance. Long synchronous scripts delay frames, input, and asynchronous results. Heavy scripts, scenes, or asset loading can still cause stutter.

Executable code must ship in a released code package : A game can execute only code in the main package or a loaded subpackage. Remote URLs may load permitted assets but cannot dynamically execute new JavaScript. # Developing your mini game Complete the game in the engine source project, then build a code package that the TikTok app can load. An engine preview proves only that the source project can run. The code package must also be validated in DevTool and in the real TikTok app.

TikTok Mini Games support frameworks such as Cocos Creator, LayaAir, and Unity. The framework or adaptation tooling converts the source project into a Mini Game code package. TikTok loads, debugs, and releases the result starting from that package. Integrate platform features such as login, IAAs, IAPs, sharing, storage, and networking in the source project. They are built into the code package with the game code. Do not maintain business logic directly in the exported code package, because the next engine build will overwrite it.

Game engine Source project Core code-package output Compatibility path Cocos Creator TypeScript or JavaScript, scenes, and assets JavaScript, entry points, configuration, adaptation code, and assets Use the framework's mini game build support LayaAir TypeScript or JavaScript, scenes, and assets JavaScript, entry, configuration, adaptation code, and assets Use the framework's mini game build support Unity C#, scenes, prefabs, and assets WebAssembly, JavaScript bridge code, data, and assets Complete the conversion described in the Unity adaptation guide The three build paths converge at the code package: DevTool loads and inspects it first, and the TikTok app then executes it. # Cocos Creator Maintain TypeScript or JavaScript, scenes, components, and assets in Cocos Creator.

Use its mini game building capabilities to generate entry files, configuration, JavaScript, adaptation code, and assets. After the build is completed, start DevTool from the export directory. Continue to make game logic and asset changes in the source project rather than in the export directory. # LayaAir Maintain TypeScript or JavaScript, scenes, and assets in LayaAir. Use its mini game building capabiliti

The rest of this page is on the live site.