TikTok for Developers

Developer Docs

Last updated October 1, 2026

Basic Utility

These basic utility APIs provide core functionality for networking and checking compatibility within the Mini Game environment.

API namespace is compatible with tt, wx, and TTMinis.game. For example, TTMinis.game.login is equivalent to tt.login and wx.login.

TTMinis.game.canIUse(schema)

Hides the keyboard.

Note: Supported starting from SDK version 0.6.0. Lower versions must be adjusted for compatibility.

Checks whether the API, callback, parameter, or option is available in the current version.

Parameters

Field

Type

Description

Required

schema

string

The schema string using the ${API}.${method}.${param}.${option} format. ${API} represents the API name. ${method} represents the call type, with valid values return, success, object, and callback. ${param} represents a parameter or return value. ${option} represents an optional value of a parameter or an attribute of a return value.

Yes


Returns

Field

Type

Description

result

Boolean

Whether the feature is available in the current version

Example

// Object property or method
TTMinis.game.canIUse('env.USER_DATA_PATH')

// TTMinis.game interface parameter, callback, or return value
TTMinis.game.canIUse('openBluetoothAdapter')
TTMinis.game.canIUse('getSystemInfoSync.return.safeArea.left')
TTMinis.game.canIUse('getSystemInfo.success.screenWidth')
TTMinis.game.canIUse('showToast.object.image')
TTMinis.game.canIUse('onCompassChange.callback.direction')
TTMinis.game.canIUse('request.object.method.GET')

TTMinis.game.env

Provides environment variables for the mini game.

Properties

Field

Type

Description

USER_DATA_PATH

string

The user directory path in the file system (local path)

TikTok for Developers