TikTok for Developers

Developer Docs

Last updated October 1, 2026

Update Management

JSBridge APIs for managing versions of your mini game.

Note: Pay attention to the following:

  • Register version management listeners at the game entry point, before the first scene loads.
  • Avoid registering the same type of listener multiple times across different scenes or in repeatedly executed initialization logic.
  • Avoid restarting the game immediately during real-time matches, payment, or reward settlement. Prompt the user to update at an appropriate business timing instead.

TTMinis.game.getUpdateManager()

Gets the global singleton version manager. The client automatically checks for new versions when the mini game starts, so developers do not need to manually initiate a version check.

Returns

An UpdateManager object. Repeated calls within the same JavaScript runtime return the same object.

Example

const updateManager = TTMinis.game.getUpdateManager()

UpdateManager

Used to listen for version check results and update package readiness, and to apply updates when a new version is ready.

UpdateManager.onCheckForUpdate(listener)

Registers a listener for the version check completion event. Registering a listener does not proactively trigger a new version check.

Parameters

Field

Type

Description

Required

listener

function

The listener function for the version check completion event

Yes

Listener callback parameters

Field

Type

Description

hasUpdate

Boolean

Whether a new version is available. If true, a new version exists. If false, the current version is the latest.

Example

const updateManager = TTMinis.game.getUpdateManager()

updateManager.onCheckForUpdate((res) => {
  console.log('Has new version:', res.hasUpdate)
})

UpdateManager.onUpdateReady(listener)

Registers a listener for the new version ready event. When this event is received, you can call applyUpdate() to apply the new version.

Parameters

Field

Type

Description

Required

listener

function

The listener function for the new version ready event. The callback takes no parameters.

Yes

Example

const updateManager = TTMinis.game.getUpdateManager()

updateManager.onUpdateReady(() => {
  console.log('New version is ready')
})

UpdateManager.onUpdateFailed(listener)

Registers a listener for the new version preparation failure event. When this event is received, the mini game can continue using the current version.

Parameters

Field

Type

Description

Required

listener

function

The listener function for the new version preparation failure event. The callback takes no parameters.

Yes

Example

const updateManager = TTMinis.game.getUpdateManager()

updateManager.onUpdateFailed(() => {
  console.warn('New version preparation failed, continuing with current version')
})

UpdateManager.applyUpdate()

Applies the prepared new version and restarts the mini game. Only call this after receiving onUpdateReady, and save game progress and other business state that needs to be restored before calling.

Example

const updateManager = TTMinis.game.getUpdateManager()

updateManager.onUpdateReady(() => {
  // Save game progress and get user confirmation before applying the update
  updateManager.applyUpdate()
})
TikTok for Developers