. Use TikPlay.on(key, callback) for specific interactions or TikPlay.on('*', callback) for all events."},{"@type":"HowToSection","name":"Web: File Structure","description":"Required files: index.html, game.js, interactions.json, thumbnail (16:9), icon (1:1). Optional: assets folder."},{"@type":"HowToSection","name":"Interactions Format","description":"Define interactions.json with keys, labels, categories, presetType (like/gift/follow/share/comment), and threshold settings (small/medium/large)."},{"@type":"HowToSection","name":"Submission Checklist","description":"Verify game loads, SDK connects, all interaction keys have handlers, game handles rapid events, responsive to window resize, no hardcoded URLs."}],"isAccessibleForFree":true,"license":"https://tikplay.games/developer-agreement"} in your HTML. The SDK communicates via postMessage between the TikPlay platform and your game iframe. Use TikPlay.on('interaction_key', callback) to handle specific events, or TikPlay.on('*', callback) for all events. Call TikPlay.ready() when your game is loaded."}},{"@type":"Question","name":"What is the TikTokEventData format in Unity?","acceptedAnswer":{"@type":"Answer","text":"TikTokEventData is a C# class with fields: interaction (string, the action key), user (string, TikTok username), count (int, trigger count), timestamp (long, Unix timestamp), eventType (string: gift/like/follow/share/comment), showName (bool), nameDisplay (string), and isInvertedControl (bool). Parsed from JSON via JsonUtility.FromJson."}},{"@type":"Question","name":"How much revenue do TikPlay developers earn?","acceptedAnswer":{"@type":"Answer","text":"TikPlay offers a 50% revenue share for game developers. Revenue is calculated based on playtime of your games by streamers. Payouts are processed monthly via Stripe. The developer program is free to join."}}]}

Developer Docs

Game Development

Overview

TikPlay communicates with Unity games via the SendMessage API. Your game receives JSON event data through a specific method that you must implement.

TikTok Live → TikPlay Backend → Frontend (WebSocket) → Unity (SendMessage)

1. Create the _GameManagers GameObject

TikPlay sends all events to a GameObject named _GameManagers. This is a required naming convention.

  1. In your Unity scene, create an empty GameObject
  2. Name it exactly: _GameManagers
  3. Attach your TikTokEventManager script to this GameObject
Hierarchy Structure
Hierarchy:
└── _GameManagers          ← REQUIRED NAME
    └── TikTokEventManager (Script)

Tip: The underscore prefix ensures the object appears at the top of the hierarchy and is easy to find.