tencent cloud

API Overview
Last updated: 2025-10-14 14:47:34
API Overview
Last updated: 2025-10-14 14:47:34

Basic

System capabilities

Name
Feature description
Minimum version
canIUse
Checks whether the APIs, callbacks, parameters, and components of the mini game are supported in the current version.
2.0.9
env
Environment variables.
2.0.9

System

Name
Feature description
Minimum version
Asynchronously gets system information.
2.0.9
Synchronously gets system information.
2.0.9
Asynchronously gets system information.
2.0.9
Gets window information.
2.0.9
Gets device settings.
2.0.9
Gets basic information of the device.
2.0.9
Gets basic information of the app.
2.0.9
Gets authorization settings of the app.
2.0.9

Update

Name
Feature description
Minimum version
Gets the global unique version update manager for managing game updates.
2.0.9
Forces the mini game to restart and uses the new version.
2.0.9
Listens for the event of the update check request to the backend.
2.0.9
Checks mini game update failure event.
2.0.9
Checks mini game version update event.
2.0.9

Mini program

Name
Feature description
Minimum version
Gets the parameters when the mini game is launched.
2.0.9
Gets the parameters when the mini game is launched this time.
2.0.9
onError
Listens for mini program error event.
2.0.9
offError
Removes the listener for mini program error event.
2.0.9
onShow
Listens for the event when the mini game returns to the frontend.
2.0.9
onHide
Listens for the event when the mini game returns to the backend.
2.0.9
offShow
Removes the listener for the event when the mini game switches to the frontend.
2.0.9
offHide
Removes the listener for the event when the mini game switches to the backend.
2.0.9

Debug

Name
Feature description
Minimum version
Sets whether to enable the debugging.
2.0.9
Gets the log manager object.
2.0.9
Prints debug logs to the debug panel.
2.0.9
Prints error logs to the debug panel.
2.0.9
Creates a new group in the debug panel.
2.0.9
Ends a group created by console.group.
2.0.9
Prints info logs in the debugging panel.
2.0.9
Prints log logs to the debug panel.
2.0.9
Prints warn logs to the debug panel.
2.0.9
Writes debug logs.
2.0.9
Writes info logs.
2.0.9
Writes log messages.
2.0.9
Writes warning logs.
2.0.9
Adds filter keywords.
2.0.9
Writes error logs.
2.0.9
Gets the current cache remaining space.
2.0.9
Sets the page parameter for real-time logs
2.0.9
Writes info logs.
2.0.9
Sets filter keywords.
2.0.9
Writes warning logs.
2.0.9

Performance

Name
Feature description
Minimum version
triggerGC
Accelerates triggering of JavaScriptCore garbage collection (GC).
2.0.9
Gets performance manager.
2.0.9
Performance manager.
2.0.9

Subpackage

Name
Feature description
Minimum version
Triggers subpackage pre-download.
2.0.9
Triggers subpackage loading. For details, see Subpackage Loading
2.0.9
Instance of a subpackage loading task, used to get the loading status of the subpackage.
2.0.9
Instance of a subpackage pre-download task, used to get the pre-download status of the subpackage.
2.0.9

Redirect

Name
Feature description
Minimum version
Exits the current mini program.
2.0.9
Opens another mini program.
2.0.9
Returns to the previous mini program. This API can be called successfully only when the current mini program is opened by another mini program.
2.0.9

Share

Name
Feature description
Minimum version
Hides the Share button on the current page.
2.0.9
Shows the Share button on the current page.
2.0.9
Opens the pop-up window for image sharing.
2.0.9
Listens for the event triggered when the user taps the “Share” button in the top right menu.
2.0.9
onCopyUrl
Listens for the event triggered when the user taps the “Copy link” button in the top right menu.
2.0.9
Removes all listener functions for the event triggered when the user taps the “Copy link” button in the top right menu.
2.0.9

Interface

Interaction

Name
Feature description
Minimum version
Hides the loading prompt box.
2.0.9
hideToast
Hides the message prompt box.
2.0.9
Shows the action menu.
2.0.9
Shows the loading prompt box.
2.0.9
showModal
Shows the modal dialog box.
2.0.9
showToast
Shows the message prompt box.
2.0.9

Menu

Name
Feature description
Minimum version
Gets the layout position information of the menu button (capsule button in the top right corner).
2.0.9

Network‍

Initiate request

Name
Feature description
Minimum version
request
Initiates an HTTPS network request.
2.0.9
Aborts the request task.
2.0.9
Listens for the Transfer-Encoding Chunk Received event.
2.0.9
Removes the listener for the Transfer-Encoding Chunk Received event.
2.0.9
Listens for the HTTP Response Header event.
2.0.9
Removes the listener for the HTTP Response Header event.
2.0.9

Upload

Name
Feature description
Minimum version
Uploads local resources to the server.
2.0.9
Aborts the upload task.
2.0.9
Listens for upload progress change events.
2.0.9
Cancels the listener for upload progress change events.
2.0.9
Listens for the HTTP Response Header event.
2.0.9
Removes the listener for the HTTP Response Header event.
2.0.9

Download

Name
Feature description
Minimum version
Downloads file resources to the local device. The client initiates an HTTPS GET request and returns the local temporary path of the file. The maximum allowed file size for a single download is 200 MB.
2.0.9
Aborts the download task.
2.0.9
Listens for download progress change event.
2.0.9
Removes the listener for download progress change event.
2.0.9
Listens for the HTTP Response Header event.
2.0.9
Removes the listener for the HTTP Response Header event.
2.0.9

WebSocket

Name
Feature description
Minimum version
Sends data through a WebSocket connection. You need to call wx.connectSocket first and send data after the wx.onSocketOpen callback.
2.0.9
Listens for the WebSocket connection open event.
2.0.9
Listens for messages received from the server through WebSocket.
2.0.9
Listens for WebSocket error event.
2.0.9
Listens for the WebSocket connection close event.
2.0.9
Creates a WebSocket connection.
2.0.9
Disables a WebSocket connection.
2.0.9
Disables a WebSocket connection.
2.0.9
Listens for the WebSocket connection close event.
2.0.9
Listens for WebSocket error event.
2.0.9
Listens for messages received from the server through WebSocket.
2.0.9
Listens for the WebSocket connection open event.
2.0.9
Sends data through a WebSocket connection.
2.0.9

Virtual payment

Name
Feature description
Minimum version
Initiates a payment request for a direct virtual item purchase.
2.2.4

Data cache

Name
Feature description
Minimum version
Synchronously stores the data in local cache under the specified key.
2.0.9
Synchronously stores the data in local cache under the specified key.
2.0.9
Destroys data in memory based on the URL.
2.0.9
Removes the specified key from the local cache.
2.0.9
Synchronously removes the specified key from local cache.
2.0.9
Asynchronously gets the content of the specified key from the local cache.
2.0.9
Creates a unique URL in memory based on the provided buffer.
2.0.9
Synchronously gets the content of the specified key from the local cache.
2.0.9
Asynchronously gets the information of the current storage.
2.0.9
Synchronously gets the information of the current storage.
2.0.9
Clears the local data cache.
2.0.9
Synchronously clears local data cache.
2.0.9

Render

Canvas

Name
Feature description
Minimum version
Creates a canvas object.
2.0.9
Canvas
Canvas object.
2.0.9
Gets the drawing context of a canvas object.
2.0.9
Returns the content drawn on the canvas as a data URI.
2.0.9
Drawing context of the canvas object.
2.0.9

Frame rate

Name
Feature description
Minimum version
Modifies the rendering frame rate.
2.0.9
Cancels an animation frame request added by requestAnimationFrame.
2.0.9
Schedules a callback to be executed before the next repaint.
2.0.9

Font

Name
Feature description
Minimum version
loadFont
Loads the custom font file.
2.0.9
Gets the line height of a text.
2.0.9

Image

Name
Feature description
Minimum version
Creates an image object.
2.0.9
Image
Image object.
2.0.9

Media

Audio

Name
Feature description
Minimum version
Sets the playback options for InnerAudioContext.
2.0.9
Gets the currently supported audio input sources.
2.0.9
Creates the InnerAudioContext object of the internal component audio.
2.0.9
Terminates the current instance.
2.0.9
Removes the listener for the event when the audio is ready to play.
2.0.9
Removes the listener for the event when the audio plays from the beginning until the end.
2.0.9
Removes the listener for audio playback error event.
2.0.9
Removes the listener for audio pause event.
2.0.9
Removes the listener for audio playback event.
2.0.9
Removes the listener for the event when the audio has jumped to a specified position.
2.0.9
Removes the listener for the event when the audio is jumping to a specified position.
2.0.9
Removes the listener for audio stop event.
2.0.9
Removes the listener for audio playback progress update event.
2.0.9
Removes the listener for audio loading event.
2.0.9
Listens for the event when the audio can start playing.
2.0.9
Listens for the event when the audio naturally ends.
2.0.9
Listens for audio playback error event.
2.0.9
Listens for audio pause event.
2.0.9
Listens for audio playback event.
2.0.9
Listens for the event when audio seeking is completed.
2.0.9
Listens for audio seeking event.
2.0.9
Listens for audio stop event.
2.0.9
Listens for audio playback progress update event.
2.0.9
Listens for audio loading event.
2.0.9
Pause the audio.
2.0.9
Plays the audio.
2.0.9
Seeks to a specified position in the audio.
2.0.9
Stops the playback.
2.0.9

Image

Name
Feature description
Minimum version
Allows users to select images from the local photo album or take photos using the camera.
2.0.9
Compresses an image with optional compression quality settings.
2.0.9
Previews an image in full screen on a new page.
2.0.9
Saves an image to the system album.
2.0.9

Location

Name
Feature description
Minimum version
Gets the current geographic location and speed.
2.0.9
Gets the current fuzzy geographic location.
2.0.9

File

File overview

Name
Description
Minimum version
Gets the globally unique file manager.
2.0.9
Result of file read operation.
2.0.9
Result of file write operation.
2.0.9

FileSystemManager

API
Description
Minimum version
Checks if a file/directory exists.
2.0.9
Synchronously checks if a file/directory exists.
2.0.9
Appends content to the end of a file.
2.0.9
Synchronously appends content to the end of a file.
2.0.9
Closes a file.
2.0.9
Synchronously closes a file.
2.0.9
Copies a file.
2.0.9
Synchronously copies a file.
2.0.9
Gets status information of a file.
2.0.9
Synchronously gets status information of a file.
2.0.9
Truncates file contents.
2.0.9
Synchronously truncates the file contents.
2.0.9
Gets the information of local temporary file or local cache file in this mini program.
2.0.9
Gets the list of local cache files saved in this mini program.
2.0.9
Creates a directory.
2.0.9
Synchronously creates a directory.
2.0.9
Opens a file and returns a file descriptor.
2.0.9
Synchronously opens a file and returns a file descriptor.
2.0.9
Synchronously reads a file.
2.0.9
Synchronously reads a file.
2.0.9
Reads the local file contents of the specified compression type.
2.0.9
Synchronously reads the local file contents of specified compression type.
2.0.9
Reads the list of files in the directory.
2.0.9
Synchronously reads the list of files in the directory.
2.0.9
Reads local file contents.
2.0.9
Synchronously reads local file contents.
2.0.9
Reads files in a compressed package.
2.0.9
Deletes saved local cache files in this mini program.
2.0.9
Renames a file.
2.0.9
Synchronously renames a file.
2.0.9
Deletes a directory.
2.0.9
Synchronously deletes a directory.
2.0.9
Saves temporary files to local.
2.0.9
Synchronously saves temporary files to local.
2.0.9
Gets a file Stats object.
2.0.9
Synchronously gets a file Stats object.
2.0.9
Truncates file contents.
2.0.9
Synchronously truncates file contents.
2.0.9
Deletes a file.
2.0.9
Synchronously deletes a file.
2.0.9
Decompresses a file.
2.0.9
Writes to a file.
2.0.9
Synchronously writes to a file.
2.0.9
Writes a file.
2.0.9
Synchronously writes a file.
2.0.9

Stats

API
Description
Minimum version
Checks whether the current file is a directory.
2.0.9
Checks whether the current file is a normal file.
2.0.9

Open APIs

Login

Name
Feature description
Minimum version
login
Calls the API to get the login credential (code).
2.0.9
Checks if the login session has expired.
2.0.9

Account information

Name
Feature description
Minimum version
Gets the current account information.
2.0.9

User information

Name
Feature description
Minimum version
Gets user information, requires user authorization for scope.userInfo.
2.0.9
userInfo
User information.
2.0.9

Settings

Name
Feature description
Minimum version
User’s authorization settings information.
2.0.9
Gets the user's current settings.
2.0.9
Opens the mini program settings interface and returns the user's operation results.
2.0.9

Authorization

Name
Feature description
Minimum version
authorize
Initiates an authorization request to the user in advance.
2.0.9

Privacy information authorization

Name
Feature description
Minimum version
Simulates a privacy API call and triggers the privacy popup logic.
2.0.9
Listens for the event when the privacy API requires user authorization.


Subscription messages

Name
Feature description
Minimum version
Triggers the subscription message page of the mini game in the superapp and returns the user's subscription message operation results.
2.2.5

Device

Keyboard

Name
Feature description
Minimum version
Updates the content in the keyboard input box.
2.0.9
Displays the keyboard.
2.0.9
Listens for keyboard input event.
2.0.9
Listens for keyboard height change event.
2.0.9
Listens for the event when the user taps the Done button on the keyboard.
2.0.9
Listens for the event when the keyboard is hidden.
2.0.9
Removes the listener for keyboard input event.
2.0.9
Removes the listener for keyboard height change event.
2.0.9
Removes the listener for the event when the user taps the Done button on the keyboard.
2.0.9
Removes the listener for the keyboard hidden event.
2.0.9
Hides the keyboard.
2.0.9

Touch

Name
Feature description
Minimum version
Listens for the start of a touch event.
2.0.9
Listens for touch move event.
2.0.9
Listens for the end of a touch event.
2.0.9
Listens for touch cancel event.
2.0.9
Removes the listener for the touch start event.
2.0.9
Removes the listener for touch move event.
2.0.9
Removes the listener for the end of a touch event.
2.0.9
Removes the listener for touch cancel event.
2.0.9
Touch
A touch point on a touch device.
2.0.9

Battery

Name
Feature description
Minimum version
Synchronously gets battery information of the device.
2.0.9
Gets battery information of the device.
2.0.9

Clipboard

Name
Feature description
Minimum version
Sets the content of the system clipboard.
2.0.9
Gets the content of the system clipboard.
2.0.9

Network‍

Name
Feature description
Minimum version
Listens for network status change event.
2.0.9
Gets the network type.
2.0.9
Removes the listener for network status change event.
2.0.9

Screen

Name
Feature description
Minimum version
Sets the screen performance during screenshot/recording.
2.0.9
Sets the screen brightness.
2.0.9
Sets whether to keep the screen on.
2.0.9
Listens for user-initiated screenshot event.
2.0.9
Listens for user-initiated screen recording event.
2.0.9
User-initiated screenshot event.
2.0.9
Removes the listener for user-initiated screen recording event.
2.0.9
Checks if the user is recording the screen.
2.0.9
Gets the screen brightness.
2.0.9

Accelerometer

Name
Feature description
Minimum version
Starts listening for accelerometer data.
2.0.9
Stops listening for acceleration data.
2.0.9
Listens for accelerometer data change event.
2.0.9
Removes the listener for accelerometer data changes event.
2.0.9

Compass

Name
Feature description
Minimum version
Starts listening for compass data.
2.0.9
Stops listening for compass data event.
2.0.9
Listens for compass data change event.
2.0.9
Removes the listener for compass data change event.
2.0.9

Device motion

Name
Feature description
Minimum version
Stops listening for device motion change event.
2.0.9
Starts listening for device motion change event.
2.0.9
Listens for device motion change event.
2.0.9
Removes the listener for device motion change event.
2.0.9

Screen orientation

Name
Feature description
Minimum version
Listens for screen orientation switching event.
2.0.9
Removes the listener for screen orientation switching event.
2.0.9

Gyroscope

Name
Feature description
Minimum version
Starts listening for gyroscope data.
2.0.9
Stops listening for gyroscope data.
2.0.9
Listens for gyroscope data change event.
2.0.9
Removes the listener for gyroscope data change event.
2.0.9

Memory

Name
Feature description
Minimum version
Listens for the low memory alert event.
2.0.9
Removes the listener for the low memory alert event.
2.0.9

Vibration

Name
Feature description
Minimum version
Causes a short vibration (15 ms).
2.0.9
Causes a long vibration (400 ms).
2.0.9

Worker

Name
Feature description
Minimum version
Creates a worker thread.
2.0.9
Worker
Worker instance, which can be obtained in the main thread via wx.createWorker, or in the Worker thread via the global variable worker.
2.0.9
Listens for messages sent from the main thread/worker thread to the current thread.
2.0.9
Messages sent to the main/worker thread.
2.0.9
Ends the current worker thread.
2.0.9

Ad

Name
Feature description
Minimum version
Creates a rewarded video ad component.
2.2.3
Creates a banner ad component.
2.2.3
Rewarded video ad component.
2.2.3
Destroys a rewarded video ad instance.
2.2.3
Loads a rewarded video ad.
2.2.3
Removes the listener for the event when a user taps the close button.
2.2.3
Removes the listener for rewarded video error events.
2.2.3
Removes the listener for the rewarded video ad loading event.
2.2.3
Listens for the event when a user taps the close button.
2.2.3
Listens for rewarded video error events.
2.2.3
Listens for the rewarded video ad loading event.
2.2.3
Shows a rewarded video ad.
2.2.3
BannerAd
Banner ad component.
2.2.3
Destroys a banner ad.
2.2.3
Hides a banner ad.
2.2.3
Removes the listener for banner ad error events.
2.2.3
Removes the listener for the banner ad loading event.
2.2.3
Removes the listener for the banner ad size change event.
2.2.3
Listens for banner ad error events.
2.2.3
Listens for the banner ad loading event.
2.2.3
Listens for the banner ad size change event.
2.2.3
Shows a banner ad.
2.2.3


Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback