View Markdown

Basic

API NameDescription
wx.envEnvironment variables
wx.canIUseDetermines whether the APIs, callbacks, parameters, and components of Mini Progr
wx.base64ToArrayBufferConverts a Base64 string to an ArrayBuffer object.
wx.arrayBufferToBase64Converts an ArrayBuffer object to a Base64 string.

System

API NameDescription
wx.openSystemBluetoothSettingNavigate to the system Bluetooth settings page
wx.openAppAuthorizeSettingNavigate to the system WeChat authorization management page
wx.getWindowInfoGet window information
wx.getSystemSettingGet device settings
wx.getSystemInfoSyncSynchronous version of wx.getSystemInfo
wx.getSystemInfoAsyncGet system information asynchronously
wx.getSystemInfoGet system information
wx.getSkylineInfoSyncGet the support status of the Skyline rendering engine in the current runtime en
wx.getSkylineInfoGet the support status of the Skyline rendering engine in the current runtime en
wx.getRendererUserAgentGet the UserAgent of the Webview Mini Program
wx.getDeviceInfoGet device basic information
wx.getDeviceBenchmarkInfoGet device performance score and model tier data
wx.getAppBaseInfoGet WeChat app basic information
wx.getAppAuthorizeSettingGet WeChat app authorization settings

Update

API NameDescription
wx.updateWeChatAppUpdates the client version.
wx.getUpdateManagerGets the globally unique version update manager, which is used to manage Mini Pr
wx.getPluginUpdateManagerGets the plugin version update manager, which is used to manage updates for a sp

PluginUpdateManager

API NameDescription
PluginUpdateManager.onCheckForUpdateListens for the event where the Mini Program requests to check the plugin update
PluginUpdateManager.onUpdateFailedListens for the plugin update failure event.
PluginUpdateManager.onUpdateReadyListens for the event where a new version of the plugin is available.

UpdateManager

API NameDescription
UpdateManager.applyUpdateForces Mini Program to restart and use the new version.
UpdateManager.onCheckForUpdateListens for the event where the Mini Program requests to check the update result
UpdateManager.onUpdateFailedListens for the Mini Program update failure event.
UpdateManager.onUpdateReadyListens for the event where a new version of Mini Program is available.

Mini Program

Lifecycle

API NameDescription
wx.onApiCategoryChangeListen to API category change events
wx.offApiCategoryChangeRemove the listener function for API category change events
wx.getLaunchOptionsSyncGet the parameters from the Mini Program startup
wx.getEnterOptionsSyncGet the parameters from the most recent foreground entry of Mini Program
wx.getApiCategoryGet the current API category

Application-level events

API NameDescription
wx.postMessageToReferrerPageSend a message to the originating page
wx.postMessageToReferrerMiniProgramSend a message to the originating Mini Program from which the navigation was ini
wx.onUnhandledRejectionListen to the unhandled Promise rejection event
wx.onThemeChangeListen to the system theme change event
wx.onPageNotFoundListen to the event where the page to be opened in Mini Program does not exist
wx.onLazyLoadErrorListen to the Mini Program async component loading failure event
wx.onErrorListen to the Mini Program error event
wx.onAudioInterruptionEndListen to the end of the audio interruption event
wx.onAudioInterruptionBeginListen to the event where audio playback starts being interrupted due to system
wx.onAppShowListen to the Mini Program resume-to-foreground event
wx.onAppHideListen to Mini Program switching to background event
wx.offUnhandledRejectionRemove the listener function for unhandled Promise rejection event
wx.offThemeChangeRemove the listener function for system theme change event
wx.offPageNotFoundRemove the listener function for Mini Program page not found event
wx.offLazyLoadErrorRemove the listener function for Mini Program async component loading failure ev
wx.offErrorRemove the listener function for Mini Program error event
wx.offAudioInterruptionEndRemove the listener function for audio interruption end event
wx.offAudioInterruptionBeginRemove the listener function for audio interruption start event caused by system
wx.offAppShowRemove the listener function for Mini Program switching to foreground event
wx.offAppHideRemove the listener function for Mini Program switching to background event

Routing events

API NameDescription
wx.onBeforePageUnloadListen to the event before an existing page instance is destroyed due to a routi
wx.onBeforePageLoadListen to the event before a new page instance is instantiated due to a routing
wx.onBeforeAppRouteListen to the event after the routing event is dispatched but before the routing
wx.onAppRouteDoneListen to the event when the current routing animation execution is completed. S
wx.onAppRouteListen to the event after the routing event is dispatched and the routing logic
wx.onAfterPageUnloadListen to the event when an existing page instance is destroyed due to a routing
wx.onAfterPageLoadListen to the event when a new page instance is created due to a routing event a
wx.offBeforePageUnloadRemove the listener function for routing events
wx.offBeforePageLoadRemove the listener function for routing events
wx.offBeforeAppRouteRemove the listener function for routing events
wx.offAppRouteDoneRemove the listener function for the event of the current routing animation comp
wx.offAppRouteRemove the listener function for routing events
wx.offAfterPageUnloadRemove the listener function for routing events
wx.offAfterPageLoadRemove the listener function for routing events

Debugging

API NameDescription
wx.setEnableDebugSet whether to enable the debug switch
wx.getRealtimeLogManagerGet the real-time log manager object
wx.getLogManagerGet the log manager object

console

API NameDescription
console.debugPrint debug logs to the debugging panel
console.errorPrint error logs to the debugging panel
console.groupCreate a new group in the debugging panel
console.groupEndEnd the group created by console.group
console.infoPrint info logs to the debugging panel
console.logPrint log logs to the debugging panel
console.warnPrint warn logs to the debugging panel

LogManager

API NameDescription
LogManager.debugWrite a debug log
LogManager.infoWrite an info log
LogManager.logWrite a log
LogManager.warnWrite a warn log

RealtimeLogManager

API NameDescription
RealtimeLogManager.addFilterMsgAdd a filter keyword. Not supported in plugins yet
RealtimeLogManager.errorWrite an error log. Not supported in plugins yet
RealtimeLogManager.getCurrentStateReal-time logs aggregate and report logs cached within a specific time interval.
RealtimeLogManager.inSet the page containing the real-time log page parameter. Not supported in plugi
RealtimeLogManager.infoWrite an info log. Not supported in plugins yet
RealtimeLogManager.setFilterMsgSet the filter keyword. Not supported in plugins yet
RealtimeLogManager.tagGet the log manager instance for the specified tag. Currently, only supported in
RealtimeLogManager.warnWrite a warn log. Not supported in plugins yet

RealtimeTagLogManager

API NameDescription
RealtimeTagLogManager.addFilterMsgAdd a filter keyword
RealtimeTagLogManager.errorWrite an error log
RealtimeTagLogManager.infoWrite info log
RealtimeTagLogManager.setFilterMsgSet filter keywords
RealtimeTagLogManager.warnWrite warn log

Performance

API NameDescription
wx.requestIdleCallbackRegister a function to be called during idle periods
wx.reportPerformanceMini Program speed measurement reporting
wx.preloadWebviewPreload the WebView for the next page
wx.preloadSkylineViewPreload the Skyline runtime environment required by the next page
wx.preloadAssetsPreload media resource files for the view layer; currently supported: font, imag
wx.getPerformanceGet current Mini Program performance-related information
wx.cancelIdleCallbackUnregister the specified callback function previously registered
PerformanceEntrySingle performance data entry

EntryList

API NameDescription
EntryList.getEntriesThis method returns all performance data in the current list
EntryList.getEntriesByNameGet all performance data in the current list with the name [name] and type [entr
EntryList.getEntriesByTypeGet all performance data in the current list with the type [entryType]

Performance

API NameDescription
Performance.createObserverCreate a global performance event listener
Performance.getEntriesThis method returns all performance data in the current buffer
Performance.getEntriesByNameGet all performance data in the current buffer with the name [name] and type [en
Performance.getEntriesByTypeGet all performance data in the current buffer with the type [entryType]
Performance.setBufferSizeSet the buffer size; by default, 30 performance data entries are buffered

PerformanceObserver

API NameDescription
PerformanceObserver.disconnectStop listening
PerformanceObserver.observeStart listening

Subpackage loading

API NameDescription
wx.preDownloadSubpackageTrigger subpackage pre-download

PreDownloadSubpackageTask

API NameDescription
PreDownloadSubpackageTask.onProgressUpdateListen for subpackage loading progress change events

Encryption

API NameDescription
wx.getUserCryptoManagerGet the user encryption module

UserCryptoManager

API NameDescription
UserCryptoManager.getLatestUserKeyGet the latest user encryption key
UserCryptoManager.getRandomValuesGet cryptographically secure random numbers

Routing

API NameDescription
wx.switchTabNavigate to a tabBar page and close all other non-tabBar pages.
wx.rewriteRouteRewrite the ongoing routing event. For details, see Routing Rewrite.
wx.reLaunchClose all pages and open a specified page within the Mini Program.
wx.redirectToClose the current page and navigate to a specified page within the Mini Program.
wx.navigateToKeep the current page and navigate to a specified page within the Mini Program.
wx.navigateBackClose the current page and return to the previous page or multiple levels up.

EventChannel

API NameDescription
EventChannel.emitTrigger an event.
EventChannel.offRemove the listener for an event.
EventChannel.onContinuously listen to an event.
EventChannel.onceListen to an event once; the listener becomes invalid after it is triggered.

Custom Routing

API NameDescription
wx.routerThe router object, which can be obtained via .

Basic

API NameDescription
router.addRouteBuilderAdd custom routing configuration.
router.getRouteContextGet the custom routing context object corresponding to the page.
router.removeRouteBuilderRemove custom routing configuration.
API NameDescription
wx.restartMiniProgramRestart the current Mini Program
wx.requestAutomaticRepaymentUse Mini Program in the WeChat client to launch a page requesting user confirmat
wx.openPhotoTopicViewOpen the WeChat official sticker topic publishing page
wx.openOfficialAccountProfileOpen the Official Account homepage via Mini Program
wx.openOfficialAccountChatOpen the Official Account chat interface via Mini Program
wx.openOfficialAccountArticleOpen any Official Account article via Mini Program (excluding articles with temp
wx.openInquiriesTopicOpen a "Ask a Question" topic via Mini Program
wx.openEmbeddedMiniProgramOpen the half-screen Mini Program
wx.onEmbeddedMiniProgramHeightChangeListen for the event of changes in the visible height of the half-screen Mini Pr
wx.offEmbeddedMiniProgramHeightChangeRemove the listener function for the event of changes in the visible height of t
wx.navigateToMiniProgramOpen another Mini Program
wx.navigateBackMiniProgramReturn to the previous Mini Program
wx.exitMiniProgramExit the current Mini Program
wx.copyRealnameReal-name information query and copy

Chat tools

API NameDescription
wx.shareVideoToGroupForwards a video to the chat
wx.shareImageToGroupForwards an image to the chat
wx.shareFileToGroupForwards a file to the chat
wx.shareEmojiToGroupForwards an emoji to the chat
wx.shareAppMessageToGroupForwards a Mini Program card to the chat
wx.selectGroupMembersSelects members from a chat room and returns the group_openid of the selected me
wx.openChatToolEnters chat tool mode
wx.notifyGroupMembersReminds the user to complete a task. The title length must not exceed 30 charact
wx.getChatToolInfoRetrieves group chat information in chat tool mode
wx.enterChatToolModeEnters the open capability mode for chat tools

Forwarding

API NameDescription
wx.updateShareMenuUpdate forwarding attributes.
wx.showShareMenuSet whether the share button in the details page opened from the top-right corne
wx.showShareImageMenuOpen the share image dialog, allowing users to send the image to a friend, share
wx.shareVideoMessageForward a video to a chat.
wx.shareToOfficialAccountSupports invoking the Sticker Publishing page, allowing users to publish images
wx.shareFileMessageForward a file to a chat.
wx.onCopyUrlListen to the event triggered when the user taps the "Copy Link" button in the t
wx.offCopyUrlRemove all listener functions for the event triggered when the user taps the "Co
wx.hideShareMenuHide the forward button on the current page.
wx.getShareInfoGet detailed forwarding information (primarily to obtain the Group ID).
wx.authPrivateMessageVerify private messages.

UI

Interaction

API NameDescription
wx.showToastShow the toast message
wx.showModalShow the modal dialog
wx.showLoadingShow the loading indicator
wx.showActionSheetShow the action menu
wx.hideToastHide the toast message
wx.hideLoadingHide the loading indicator
wx.enableAlertBeforeUnloadEnable the Mini Program page back confirmation dialog
wx.disableAlertBeforeUnloadClose the Mini Program page back confirmation dialog
API NameDescription
wx.showNavigationBarLoadingShow the navigation bar loading animation on the current page
wx.setNavigationBarTitleDynamically set the title of the current page
wx.setNavigationBarColorSet the navigation bar color of the page
wx.hideNavigationBarLoadingHide the navigation bar loading animation on the current page
wx.hideHomeButtonHide the back-to-home button

Background

API NameDescription
wx.setBackgroundTextStyleDynamically set the style of the pull-down background font and loading image
wx.setBackgroundColorDynamically set the window background color

Tab Bar

API NameDescription
wx.showTabBarRedDotShows the red badge in the upper-right corner of a specified tabBar item.
wx.showTabBarShows the tabBar.
wx.setTabBarStyleDynamically sets the overall style of the tabBar.
wx.setTabBarItemDynamically sets the content of a specified tabBar item. Since , images support
wx.setTabBarBadgeAdds text to the upper-right corner of a specified tabBar item.
wx.removeTabBarBadgeRemoves the text from the upper-right corner of a specified tabBar item.
wx.hideTabBarRedDotHides the red badge in the upper-right corner of a specified tabBar item.
wx.hideTabBarHides the tabBar.

Font

API NameDescription
wx.loadFontFaceDynamically load web fonts
wx.loadBuiltInFontFaceLoad built-in fonts

Pull-down Refresh

API NameDescription
wx.stopPullDownRefreshStop pull-down refresh on the current page
wx.startPullDownRefreshStart pull-down refresh

Scrolling

API NameDescription
wx.pageScrollToScrolls the page to the target position, supporting both selector and scroll dis

ScrollViewContext

API NameDescription
ScrollViewContext.closeRefreshDisable pull-down refresh
ScrollViewContext.closeTwoLevelDisable secondary pull-down
ScrollViewContext.scrollIntoViewScroll to a specified position
ScrollViewContext.scrollToScroll to a specified position
ScrollViewContext.triggerRefreshTrigger pull-down refresh
ScrollViewContext.triggerTwoLevelTrigger secondary pull-down

Animation

API NameDescription
wx.createAnimationCreate an animation instance animation

Animation

API NameDescription
Animation.backgroundColorSet background color
Animation.bottomSet bottom value
Animation.exportExport animation queue
Animation.heightSet height
Animation.leftSet left value
Animation.matrixSame as transform-function matrix
Animation.matrix3dSame as transform-function matrix3d
Animation.opacitySet opacity
Animation.rightSet right value
Animation.rotateRotate clockwise by an angle from the origin
Animation.rotate3dRotate clockwise by an angle from the fixed axis
Animation.rotateXRotate clockwise by an angle from the X-axis
Animation.rotateYRotate clockwise by an angle from the Y-axis
Animation.rotateZRotate clockwise by an angle from the Z-axis
Animation.scaleScale
Animation.scale3dScale
Animation.scaleXScale X-axis
Animation.scaleYScale Y-axis
Animation.scaleZScale Z-axis
Animation.skewSkew X and Y-axis coordinates
Animation.skewXSkew X-axis coordinates
Animation.skewYSkew Y-axis coordinates
Animation.stepIndicates that a group of animations has completed
Animation.topSet the top value
Animation.translateTranslation transform
Animation.translate3dApply translation transform to x, y, and z coordinates
Animation.translateXTranslate along the X-axis
Animation.translateYTranslate along the Y-axis
Animation.translateZTranslate along the Z-axis
Animation.widthSet width

Stick to top

API NameDescription
wx.setTopBarTextDynamically sets the text content of the stick-to-top bar.

Custom Component

API NameDescription
wx.nextTickDefer a part of the operation to the next time slice for execution
API NameDescription
wx.onUserTriggerTranslationListen for the event where the user triggers the translation feature in the Mini
wx.onUserOffTranslationListen for the event where the user actively cancels translation
wx.onMenuButtonBoundingClientRectWeightChangeListen for layout position changes of the menu button (capsule button in the top
wx.offUserTriggerTranslationRemove the listener function for the user triggering the translation feature in
wx.offUserOffTranslationRemove the listener function for the user actively canceling translation event
wx.offMenuButtonBoundingClientRectWeightChangeRemove the listener function for layout position changes of the menu button (cap
wx.getMenuButtonBoundingClientRectGet the layout position information of the menu button (capsule button in the to

Window

API NameDescription
wx.setWindowSizeSets the window size. This API is only applicable to the PC platform. For usage
wx.onWindowStateChangeListens to the Mini Program window state change event.
wx.onWindowResizeListens to the window size change event.
wx.onParallelStateChangeListens to the Mini Program split-view state change event.
wx.offWindowStateChangeRemoves the listener function for the Mini Program window state change event.
wx.offWindowResizeRemoves the listener function for the window size change event.
wx.offParallelStateChangeRemoves the listener function for the Mini Program split-view state change event
wx.checkIsPictureInPictureActiveReturns whether picture-in-picture playback is currently active (available under

Worklet Animation

API NameDescription
wx.workletWorklet object, which can be obtained via .

Basic

API NameDescription
worklet.cancelAnimationCancels the animation driven by .
worklet.derivedDerivative value , which can generate other shared variables based on an existin
worklet.getBoundingClientRectSynchronously retrieves the node layout boundingClientRect.
worklet.scrollViewContextinstance, which can operate components within the function.
worklet.scrollViewContext.scrollToScrolls to the specified position.
worklet.sharedCreates a shared variable , used for sharing data across threads and driving ani

Animation

API NameDescription
worklet.decayScroll-decay-based animation
worklet.EasingThe Easing module implements common animation easing functions (for animation ef
worklet.springPhysics-based animation
worklet.timingTime-based animation

Composite animation

API NameDescription
worklet.delayDelayed animation
worklet.repeatRepeated animation
worklet.sequenceCombines animation sequences to execute the passed animations in order.

Utility Functions

API NameDescription
worklet.runOnJSWhen the function runs on the thread, the captured external function may be of
worklet.runOnUIExecutes the worklet function on the UI thread.

Network

Send request

API NameDescription
wx.requestInitiates an HTTPS network request

RequestTask

API NameDescription
RequestTask.abortInterrupt the request task
RequestTask.offChunkReceivedRemoves the listener function for the Transfer-Encoding Chunk Received event
RequestTask.offHeadersReceivedRemoves the listener function for the HTTP Response Header event
RequestTask.onChunkReceivedListens to the Transfer-Encoding Chunk Received event
RequestTask.onHeadersReceivedListens to the HTTP Response Header event

Download

API NameDescription
wx.downloadFileDownload file resources to local storage

DownloadTask

API NameDescription
DownloadTask.abortInterrupt the download task
DownloadTask.offHeadersReceivedRemove the listener function for the HTTP Response Header event
DownloadTask.offProgressUpdateRemove the listener function for the download progress change event
DownloadTask.onHeadersReceivedListen for the HTTP Response Header event
DownloadTask.onProgressUpdateListen for the download progress change event

Upload

API NameDescription
wx.uploadFileUploads local resources to the server

UploadTask

API NameDescription
UploadTask.abortAborts the upload task
UploadTask.offHeadersReceivedRemoves the listener function for the HTTP Response Header event
UploadTask.offProgressUpdateRemoves the listener function for the upload progress change event
UploadTask.onHeadersReceivedListens to the HTTP Response Header event
UploadTask.onProgressUpdateListens to the upload progress change event

WebSocket

API NameDescription
wx.sendSocketMessageSend data through the WebSocket connection
wx.onSocketOpenListen for the WebSocket connection open event
wx.onSocketMessageListen for the WebSocket message received from the server event
wx.onSocketErrorListen for the WebSocket error event
wx.onSocketCloseListen for the WebSocket connection close event
wx.connectSocketCreate a WebSocket connection
wx.closeSocketClose the WebSocket connection

SocketTask

API NameDescription
SocketTask.closeCloses the WebSocket connection
SocketTask.onCloseListens to the WebSocket connection close event
SocketTask.onErrorListens to the WebSocket error event
SocketTask.onMessageListens to the WebSocket message received event
SocketTask.onOpenListens to the WebSocket connection open event
SocketTask.sendSends data over the WebSocket connection

mDNS

API NameDescription
wx.stopLocalServiceDiscoveryStop searching for mDNS services
wx.startLocalServiceDiscoveryStart searching for mDNS services on the local area network
wx.onLocalServiceResolveFailListen for the mDNS service resolution failure event
wx.onLocalServiceLostListen for the mDNS service leave event
wx.onLocalServiceFoundListen for the mDNS service discovery event
wx.onLocalServiceDiscoveryStopListen for the mDNS service stop search event
wx.offLocalServiceResolveFailRemove the listener function for the mDNS service resolution failure event
wx.offLocalServiceLostRemove the listener function for the mDNS service leave event
wx.offLocalServiceFoundRemove the listener function for the mDNS service discovery event
wx.offLocalServiceDiscoveryStopRemove the listener function for the mDNS service stop search event

TCP communication

API NameDescription
wx.createTCPSocketCreates a TCP Socket instance

TCPSocket

API NameDescription
TCPSocket.bindWifiBinds the TCP Socket to the current Wi-Fi network. The onBindWifi event is trigg
TCPSocket.closeCloses the connection
TCPSocket.connectInitiates a connection on the specified socket
TCPSocket.offBindWifiRemoves the listener function triggered when the socket successfully binds to th
TCPSocket.offCloseRemoves the listener function triggered when the socket is fully closed
TCPSocket.offConnectRemoves the listener function triggered when the socket connection is successful
TCPSocket.offErrorRemoves the listener function triggered when an error occurs
TCPSocket.offMessageRemoves the listener function triggered when data is received
TCPSocket.onBindWifiListens to the event triggered when the socket successfully binds to the current
TCPSocket.onCloseListens to the event triggered when the socket is fully closed
TCPSocket.onConnectListens to the event triggered when the socket connection is successfully establ
TCPSocket.onErrorListens to the event triggered when an error occurs
TCPSocket.onMessageListens to the event triggered when data is received
TCPSocket.writeSends data over the socket

UDP communication

API NameDescription
wx.createUDPSocketCreates a UDP Socket instance

UDPSocket

API NameDescription
UDPSocket.bindBinds to a system-assigned available port or a specified port number
UDPSocket.closeCloses the UDP Socket instance, equivalent to destroying it
UDPSocket.connectPre-connects to the specified IP and port. Must be used in conjunction with the
UDPSocket.offCloseRemoves the listener function for the close event
UDPSocket.offErrorRemoves the listener function for the error event
UDPSocket.offListeningRemoves the listener function for the event triggered when listening for packet
UDPSocket.offMessageRemoves the listener function for the message received event
UDPSocket.onCloseListens to the close event
UDPSocket.onErrorListens to the error event
UDPSocket.onListeningListens to the event triggered when listening for packet messages begins
UDPSocket.onMessageListens to the message received event
UDPSocket.sendSends a message to the specified IP and port
UDPSocket.setTTLSets the IP_TTL socket option, used to specify the maximum number of hops allowe
UDPSocket.writeUsage is identical to the send method. If connect has not been called in advance

Payment

API NameDescription
wx.verifyHKPaymentPasswordInvoke the WeChat Pay HK password verification component.
wx.requestVirtualPaymentInitiate Mi Dashi virtual payment.
wx.requestPluginPaymentInitiate payment in a plugin.
wx.requestPaymentInitiate WeChat Pay.
wx.requestOrderPaymentOnly required for Mini Program that have integrated the Custom Transaction Compo
wx.requestMerchantTransferIn the Merchant Transfer User Confirmation mode, invoke the page via Mini Progra
wx.requestCommonPaymentInitiate general payment
wx.requestAppleSubscribeSignInitiate Apple subscription agreement
wx.openHKOfflinePayViewLaunch the WeChat Pay HK payment code
wx.jumpToOfflinePayNavigate to the offline payment page
wx.createGlobalPaymentCreate an object for the global payment method

GlobalPayment

API NameDescription
GlobalPayment.abortThe user selects the TPG payment method, and the interface enters a loading Toas
GlobalPayment.openMethodPickerLaunch the payment method selection panel for Global Cashier
GlobalPayment.requestGlobalPaymentAfter the developer calls openMethodPicker and receives in the return value meth

Data Cache

API NameDescription
wx.setStorageSyncStore data under a specified key in local cache
wx.setStorageStore data under a specified key in local cache
wx.revokeBufferURLDestroy data in memory based on the URL
wx.removeStorageSyncSynchronous version of wx.removeStorage
wx.removeStorageRemove the specified key from local cache
wx.getStorageSyncSynchronously retrieve the contents of a specified key from local cache
wx.getStorageInfoSyncSynchronous version of wx.getStorageInfo
wx.getStorageInfoAsynchronously retrieve information about the current storage
wx.getStorageAsynchronously retrieve the contents of a specified key from local cache
wx.createBufferURLCreate a unique URL in memory based on the passed buffer
wx.clearStorageSyncSynchronous version of wx.clearStorage
wx.clearStorageClear local data cache
wx.batchSetStorageSyncBatch store data under specified keys in local cache
wx.batchSetStorageBatch store data under specified keys in local cache
wx.batchGetStorageSyncSynchronously batch retrieve the contents of specified keys from local cache
wx.batchGetStorageAsynchronously batch retrieve the contents of specified keys from local cache

Data pre-fetching and periodic updates.

API NameDescription
wx.setBackgroundFetchTokenSet the custom login state to be included during periodic data fetching, facilit
wx.onBackgroundFetchDataListen to the event of receiving backgroundFetch data.
wx.getBackgroundFetchTokenGet the configured custom login state.
wx.getBackgroundFetchDataRetrieve backgroundFetch client cached data.

Cache Manager

API NameDescription
wx.createCacheManagerCreate a cache manager

CacheManager

API NameDescription
CacheManager.addRuleAdd a rule.
CacheManager.addRulesBatch add rules. For rule syntax, refer to CacheManager.addRule.
CacheManager.clearCachesClear all cache.
CacheManager.clearRulesClear all rules, which also deletes all cache under the corresponding rules.
CacheManager.deleteCacheDelete cache
CacheManager.deleteCachesBatch delete cache
CacheManager.deleteRuleDelete a rule, which also deletes all caches under that rule
CacheManager.deleteRulesBatch delete rules, which also deletes all caches under those rules
CacheManager.matchMatches hit cache rules; generally used in conjunction with the request event
CacheManager.offCancel event listener
CacheManager.onListen for events
CacheManager.startEnable cache; only effective when mode is none. After the call, the state of the
CacheManager.stopDisable cache; only effective when mode is none. After the call, the state of th

Data analytics

API NameDescription
wx.reportMonitorCustom business data monitoring reporting interface
wx.reportEventEvent reporting
wx.reportAnalyticsCustom analytics data reporting interface
wx.getExptInfoSyncGiven an experiment parameter array, retrieve the corresponding experiment param
wx.getCommonConfigRetrieves the corresponding experiment parameter values given an array of experi

Canvas

API NameDescription
wx.createOffscreenCanvasCreates an offscreen canvas instance
wx.createCanvasContextCreates a Canvas drawing context CanvasContext object
wx.canvasToTempFilePathExports the content of a specified area of the current canvas to generate an ima
wx.canvasPutImageDataDraws pixel data onto the canvas
wx.canvasGetImageDataRetrieves the implied pixel data of the canvas area
ColorColor
ImageImage object
ImageDataImageData object
RenderingContextCanvas drawing context

Canvas

API NameDescription
Canvas.cancelAnimationFrameCancels an animation frame request that was added to the schedule by requestAnim
Canvas.createImageCreates an image object.
Canvas.createImageDataCreates an ImageData object.
Canvas.createPath2DCreates a Path2D object.
Canvas.getContextThis method returns the drawing context of the Canvas.
Canvas.requestAnimationFrameExecutes at the next redraw.
Canvas.toDataURLReturns a data URI containing the image representation.

CanvasContext

API NameDescription
CanvasContext.arcCreates an arc.
CanvasContext.arcToDraws an arc path based on control points and radius.
CanvasContext.beginPathStarts creating a path.
CanvasContext.bezierCurveToCreates a cubic Bézier curve path.
CanvasContext.clearRectClears the content within the specified rectangular area on the canvas.
CanvasContext.clipCuts out a shape and size of any dimension from the original canvas.
CanvasContext.closePathCloses a path.
CanvasContext.createCircularGradientCreates a radial gradient.
CanvasContext.createLinearGradientCreates a linear gradient.
CanvasContext.createPatternWait, checking translation: "Creates a pattern using the specified image, allowi
CanvasContext.drawStrokes the current path (including paths, transformations, and styles) onto the
CanvasContext.drawImageDraws an image onto the canvas.
CanvasContext.fillFills the content of the current path.
CanvasContext.fillRectFills a rectangle.
CanvasContext.fillTextDraws filled text on the canvas.
CanvasContext.lineToAdds a new point and creates a line from the last specified point to the target
CanvasContext.measureTextMeasures the size information of text.
CanvasContext.moveToMoves the path to the specified point on the canvas without creating a line.
CanvasContext.quadraticCurveToCreates a quadratic Bézier curve path.
CanvasContext.rectCreates a rectangular path.
CanvasContext.restoreRestores the previously saved drawing context.
CanvasContext.rotateRotates the current coordinate axes clockwise around the origin.
CanvasContext.saveSaves the drawing context.
CanvasContext.scaleAfter calling this method, the horizontal and vertical coordinates of subsequent
CanvasContext.setFillStyleSets the fill color.
CanvasContext.setFontSizeSets the font size.
CanvasContext.setGlobalAlphaSets the global alpha transparency.
CanvasContext.setLineCapSets the line cap style
CanvasContext.setLineDashSets the dash style
CanvasContext.setLineJoinSets the line join style
CanvasContext.setLineWidthSets the line width
CanvasContext.setMiterLimitSets the maximum miter length
CanvasContext.setShadowSets the shadow style
CanvasContext.setStrokeStyleSets the stroke color
CanvasContext.setTextAlignSets the text alignment
CanvasContext.setTextBaselineSets the vertical text alignment
CanvasContext.setTransformMethod to reset (override) the current transform using a matrix
CanvasContext.strokeDraws the outline of the current path
CanvasContext.strokeRectDraws a rectangle (unfilled)
CanvasContext.strokeTextMethod to draw text outline at the specified (x, y) position
CanvasContext.transformMethod to apply multiple transforms to the current transform using matrices
CanvasContext.translateTransforms the origin (0, 0) of the current coordinate system

CanvasGradient

API NameDescription
CanvasGradient.addColorStopAdds a gradient stop

OffscreenCanvas

API NameDescription
OffscreenCanvas.createImageCreates an Image object
OffscreenCanvas.getContextThis method returns the drawing context of the OffscreenCanvas

Path2D

API NameDescription
Path2D.addPathAdds a path to the current path
Path2D.arcAdds an arc path segment
Path2D.arcToAdds an arc path segment through the specified control points
Path2D.bezierCurveToAdds a cubic Bezier curve path
Path2D.closePathCloses the path to the starting point
Path2D.ellipseAdds an elliptical arc path
Path2D.lineToAdds a straight line path
Path2D.moveToMoves the path start point
Path2D.quadraticCurveToAdds a quadratic Bezier curve path
Path2D.rectAdds a rectangle path

Media

Map

API NameDescription
wx.createMapContextCreate a map context MapContext object

MapContext

API NameDescription
MapContext.addArcAdd arc line. You must set either waypoints or the included angle.
MapContext.addCustomLayerAdd custom layer
MapContext.addGroundOverlayCreate a custom image layer. The image will scale with the map zoom level.
MapContext.addMarkersAdd a marker
MapContext.addVisualLayerAdd a visualization layer
MapContext.eraseLinesErase or gray out line segments added to the map
MapContext.executeVisualLayerCommandExecute visualization layer commands, used in conjunction with event listeners
MapContext.fromScreenLocationGet the latitude and longitude corresponding to a point on the screen, with the
MapContext.getCenterLocationGet the latitude and longitude of the current map center
MapContext.getRegionGet the current map viewport range
MapContext.getRotateGet the current map rotation angle
MapContext.getScaleGet the current map zoom level
MapContext.getSkewGet the current map pitch angle
MapContext.includePointsZoom the viewport to display all specified latitude and longitude points
MapContext.initMarkerClusterInitialize cluster configuration; default configuration is used if not called
MapContext.moveAlongMove along a specified path, used for scenarios such as trajectory playback
MapContext.moveToLocationMove the map center to the current location; the map component's show-location p
MapContext.onListen to map events
MapContext.openMapAppLaunch the map app to select a navigation route
MapContext.removeArcRemove an arc
MapContext.removeCustomLayerRemove a personalized layer
MapContext.removeGroundOverlayRemove a custom image layer
MapContext.removeMarkersRemove a marker
MapContext.removeVisualLayerRemove a visualization layer
MapContext.setBoundaryRestrict the map's display range
MapContext.setCenterOffsetSet the map center point offset; positive values indicate movement to the right
MapContext.setLocMarkerIconSet the location point icon, supporting network paths, local paths, and code pac
MapContext.toScreenLocationGet the screen coordinates corresponding to latitude and longitude, with the ori
MapContext.translateMarkerTranslate a marker with animation
MapContext.updateGroundOverlayUpdate a custom image layer

Image

API NameDescription
wx.saveImageToPhotosAlbumSave Image to System Album
wx.previewMediaPreview Images and Videos
wx.previewImagePreview Image Fullscreen in a New Page
wx.getImageInfoGet Image Info
wx.editImageEdit Image API
wx.cropImageCrop Image API
wx.compressImageCompress Image API with Optional Quality
wx.chooseMessageFileSelect File from Client Session
wx.chooseImageChoose Image from Local Album or Take a Photo

Video

API NameDescription
wx.saveVideoToPhotosAlbumSave a video to the system album
wx.saveMediaToPhotosAlbumSave an image or video to the system album
wx.openVideoEditorOpen the video editor
wx.getVideoInfoGet detailed video information
wx.createVideoContextCreate a video context VideoContext object
wx.compressVideoVideo Compression Interface
wx.chooseVideoCapture a video or select a video from the phone album
wx.chooseMediaCapture or select an image or video from the phone album
wx.checkDeviceSupportHevcCheck if the device supports H.265 encoding

VideoContext

API NameDescription
VideoContext.exitBackgroundPlaybackExit background small window playback mode
VideoContext.exitCastingExit screen mirroring
VideoContext.exitFullScreenExit fullscreen
VideoContext.exitPictureInPictureExit small window. This method can be called on any page.
VideoContext.hideStatusBarHide the status bar. Valid only in iOS fullscreen mode.
VideoContext.pausePause Video
VideoContext.playPlay Video
VideoContext.playbackRateSet playback speed
VideoContext.reconnectCastingReconnect to the screen mirroring device
VideoContext.requestBackgroundPlaybackEnter background small window playback mode
VideoContext.requestFullScreenEnter fullscreen
VideoContext.seekSeek to a specified position
VideoContext.sendDanmuSend bullet comments
VideoContext.showStatusBarShow the status bar. Valid only in iOS fullscreen mode.
VideoContext.startCastingStart screen mirroring. Launches a half-screen device search interface.
VideoContext.stopStop Video
VideoContext.switchCastingSwitch screen mirroring device

Audio

API NameDescription
wx.stopVoiceStop the playing speech
wx.setInnerAudioOptionSet the playback options for InnerAudioContext
wx.playVoiceStart playing speech
wx.pauseVoicePause the playing speech
wx.getAvailableAudioSourcesGet the currently supported audio input sources
wx.createWebAudioContextCreate a WebAudio context
wx.createMediaAudioPlayerCreate a media audio player object MediaAudioPlayer object, which can be used to
wx.createInnerAudioContextCreate an internal audio context InnerAudioContext object
wx.createAudioContextCreate an audio context AudioContext object
AudioListenerA spatial audio listener, representing a unique position and orientation within
AudioParamThe AudioParam interface represents audio-related parameters, typically paramete
WebAudioContextNodeA class of audio processing modules; different Nodes have different functions, s

AudioBuffer

API NameDescription
AudioBuffer.copyFromChannelCopies the specified channel from the AudioBuffer to the end of the array.
AudioBuffer.copyToChannelCopies samples from the specified array to the specific channel of the audioBuff
AudioBuffer.getChannelDataReturns a Float32Array containing PCM data with channels, defined by the channel

AudioContext

API NameDescription
AudioContext.pausePause the audio.
AudioContext.playPlay the audio.
AudioContext.seekJump to a specified position.
AudioContext.setSrcSet the audio source URL.

BufferSourceNode

API NameDescription
BufferSourceNode.connectConnects to a specified destination.
BufferSourceNode.disconnectDisconnects from the connected destination node.
BufferSourceNode.startThe audio source starts playing.
BufferSourceNode.stopStop playback.

InnerAudioContext

API NameDescription
InnerAudioContext.destroyDestroy the current instance.
InnerAudioContext.offCanplayRemoves the listener function for the event triggered when the audio enters a pl
InnerAudioContext.offEndedRemoves the listener function for the event triggered when the audio naturally p
InnerAudioContext.offErrorRemoves the listener function for the audio playback error event.
InnerAudioContext.offPauseRemoves the listener function for the audio pause event.
InnerAudioContext.offPlayRemoves the listener function for the audio play event.
InnerAudioContext.offSeekedRemoves the listener function for the event triggered when the audio completes a
InnerAudioContext.offSeekingRemoves the listener function for the event triggered when the audio performs a
InnerAudioContext.offStopRemoves the listener function for the audio stop event.
InnerAudioContext.offTimeUpdateRemoves the listener function for the audio playback progress update event.
InnerAudioContext.offWaitingRemoves the listener function for the audio loading event.
InnerAudioContext.onCanplayListens for the event when the audio enters a playable state.
InnerAudioContext.onEndedListens for the event when the audio naturally plays to the end.
InnerAudioContext.onErrorListens for the audio playback error event.
InnerAudioContext.onPauseListens for the audio pause event.
InnerAudioContext.onPlayListens for the audio play event.
InnerAudioContext.onSeekedListens for the event when the audio completes a seek operation.
InnerAudioContext.onSeekingListens for the event when the audio performs a seek operation.
InnerAudioContext.onStopListens for the audio stop event.
InnerAudioContext.onTimeUpdateListens for the audio playback progress update event.
InnerAudioContext.onWaitingListens for the audio loading event.
InnerAudioContext.pausePause
InnerAudioContext.playPlay
InnerAudioContext.seekJump to a specified position.
InnerAudioContext.stopStop

MediaAudioPlayer

API NameDescription
MediaAudioPlayer.addAudioSourceAdd an audio source.
MediaAudioPlayer.destroyDestroy the player.
MediaAudioPlayer.removeAudioSourceRemove the audio source.
MediaAudioPlayer.startStart the player
MediaAudioPlayer.stopStop the player

WebAudioContext

API NameDescription
WebAudioContext.closeClose the WebAudioContext
WebAudioContext.createAnalyserCreate an AnalyserNode
WebAudioContext.createBiquadFilterCreate a BiquadFilterNode
WebAudioContext.createBufferCreate an AudioBuffer, which represents a short audio segment residing in memory
WebAudioContext.createBufferSourceCreate a BufferSourceNode instance to play audio data via an AudioBuffer object
WebAudioContext.createChannelMergerCreate a ChannelMergerNode
WebAudioContext.createChannelSplitterCreate a ChannelSplitterNode
WebAudioContext.createConstantSourceCreate a ConstantSourceNode
WebAudioContext.createDelayCreate a DelayNode
WebAudioContext.createDynamicsCompressorCreate a DynamicsCompressorNode
WebAudioContext.createGainCreate a GainNode
WebAudioContext.createIIRFilterCreate an IIRFilterNode
WebAudioContext.createOscillatorCreate an OscillatorNode
WebAudioContext.createPannerCreate a PannerNode
WebAudioContext.createPeriodicWaveCreate a PeriodicWaveNode
WebAudioContext.createScriptProcessorCreate a ScriptProcessorNode
WebAudioContext.createWaveShaperCreate a WaveShaperNode
WebAudioContext.decodeAudioDataAsynchronously decode a resource into an AudioBuffer
WebAudioContext.resumeSynchronously resume a paused WebAudioContext
WebAudioContext.suspendSynchronously pause the WebAudioContext

Background audio

API NameDescription
wx.stopBackgroundAudioStop Music Playback
wx.seekBackgroundAudioControl Music Playback Progress
wx.playBackgroundAudioPlay Music Using the Background Player
wx.pauseBackgroundAudioPause Music Playback
wx.onBackgroundAudioStopListen for Music Stop Event
wx.onBackgroundAudioPlayListen for Music Play Event
wx.onBackgroundAudioPauseListen for Music Pause Event
wx.getBackgroundAudioPlayerStateGet Background Music Playback Status
wx.getBackgroundAudioManagerGet the globally unique background audio manager

BackgroundAudioManager

API NameDescription
BackgroundAudioManager.onCanplayListen for the event when background audio becomes playable
BackgroundAudioManager.onEndedListen for the event when background audio finishes playing naturally
BackgroundAudioManager.onErrorListen for the background audio playback error event
BackgroundAudioManager.onNextListen for the event when the user taps the next track button in the system musi
BackgroundAudioManager.onPauseListen for the background audio pause event
BackgroundAudioManager.onPlayListen for the background audio playback event
BackgroundAudioManager.onPrevListen for the event when the user taps the previous track button in the system
BackgroundAudioManager.onSeekedListen for the event when background audio completes a track switching operation
BackgroundAudioManager.onSeekingListen for the event when background audio starts a track switching operation
BackgroundAudioManager.onStopListen for the background audio stop event
BackgroundAudioManager.onTimeUpdateListen for the background audio playback progress update event, which is only in
BackgroundAudioManager.onWaitingListen for the audio loading event
BackgroundAudioManager.pausePause the music
BackgroundAudioManager.playPlay the music
BackgroundAudioManager.seekJump to a specified position
BackgroundAudioManager.stopStop the music

Real-time Audio and Video

API NameDescription
wx.createLivePusherContextCreate a live-pusher context LivePusherContext object
wx.createLivePlayerContextCreate a live-player context LivePlayerContext object

LivePlayerContext

API NameDescription
LivePlayerContext.exitBackgroundPlaybackExit Background PIP Playback Mode
LivePlayerContext.exitCastingExit Screen Mirroring
LivePlayerContext.exitFullScreenExit fullscreen
LivePlayerContext.exitPictureInPictureExit small window mode. This method can be called on any page.
LivePlayerContext.muteMute
LivePlayerContext.pausePause
LivePlayerContext.playPlay
LivePlayerContext.reconnectCastingReconnect to the screen casting device
LivePlayerContext.requestBackgroundPlaybackEnter background small window playback mode
LivePlayerContext.requestFullScreenEnter fullscreen
LivePlayerContext.resumeResume
LivePlayerContext.snapshotScreenshot
LivePlayerContext.startCastingStart screen casting and launch the half-screen device search
LivePlayerContext.stopStop
LivePlayerContext.switchCastingSwitch screen casting device

LivePusherContext

API NameDescription
LivePusherContext.applyBlusherStickMakeupAdd blush beauty effect
LivePusherContext.applyEyeBrowMakeupAdd eyebrow beauty effect
LivePusherContext.applyEyeShadowMakeupAdd eyeshadow beauty effect
LivePusherContext.applyFaceContourMakeupAdd contour beauty effect
LivePusherContext.applyFilterAdd filter effect
LivePusherContext.applyLipStickMakeupAdd lipstick beauty effect
LivePusherContext.applyStickerAdd sticker effect
LivePusherContext.clearFiltersClear all filter effects
LivePusherContext.clearMakeupsClear all beauty effects
LivePusherContext.clearStickersClear all sticker effects
LivePusherContext.createOffscreenCanvasCreate an off-screen Canvas that can receive textures captured by LivePusher. Su
LivePusherContext.exitPictureInPictureExit small window mode. This method can be called on any page.
LivePusherContext.getMaxZoomGet the maximum zoom level
LivePusherContext.onCustomRendererEventWhen custom rendering is enabled, developers use this method to subscribe to rel
LivePusherContext.pausePause live streaming
LivePusherContext.pauseBGMPause background audio
LivePusherContext.playBGMPlay background audio
LivePusherContext.resumeResume live streaming
LivePusherContext.resumeBGMResume background audio
LivePusherContext.sendMessageSend SEI message
LivePusherContext.setBGMVolumeSet background audio volume
LivePusherContext.setMICVolumeSet microphone volume
LivePusherContext.setZoomSet zoom level
LivePusherContext.snapshotSnapshot
LivePusherContext.startStart live streaming and enable camera preview
LivePusherContext.startPreviewEnable camera preview
LivePusherContext.stopStop live streaming and disable camera preview
LivePusherContext.stopBGMStop background audio
LivePusherContext.stopPreviewDisable camera preview
LivePusherContext.switchCameraSwitch front and rear cameras
LivePusherContext.toggleTorchToggle flashlight

Audio recording

API NameDescription
wx.stopRecordStop Recording
wx.startRecordStart Recording
wx.getRecorderManagerGet the globally unique recorder manager RecorderManager

RecorderManager

API NameDescription
RecorderManager.onErrorListen to audio recording error events
RecorderManager.onFrameRecordedListen to events where a file of the specified frame size has been recorded
RecorderManager.onInterruptionBeginListen to events where audio recording is interrupted due to system usage
RecorderManager.onInterruptionEndListen to audio recording interruption end events
RecorderManager.onPauseListen to audio recording pause events
RecorderManager.onResumeListen to audio recording resume events
RecorderManager.onStartListen to audio recording start events
RecorderManager.onStopListen to audio recording end events
RecorderManager.pausePause audio recording
RecorderManager.resumeResume audio recording
RecorderManager.startStart audio recording
RecorderManager.stopStop Recording

Camera

API NameDescription
wx.createCameraContextCreate camera Context CameraContext Object

CameraContext

API NameDescription
CameraContext.onCameraFrameGet Real-time Frame Data from the Camera
CameraContext.setZoomSet Zoom Level
CameraContext.startRecordStart Video Recording
CameraContext.stopRecordStop Video Recording
CameraContext.takePhotoTake a Photo

CameraFrameListener

API NameDescription
CameraFrameListener.startStart Listening to Frame Data
CameraFrameListener.stopStop Listening to Frame Data

Rich Text

EditorContext

API NameDescription
EditorContext.blurBlur the Editor and Close the Keyboard
EditorContext.clearClear Editor Content
EditorContext.deleteTextDelete Content in the Specified Selection
EditorContext.formatModify Styles
EditorContext.getBoundsGet the Position and Size of the Specified Selection
EditorContext.getContentsGet Editor Content
EditorContext.getHistoryStateGet History State
EditorContext.getSelectionGet Current Selection
EditorContext.getSelectionTextGet Plain Text Content of the Current Selection
EditorContext.insertCustomBlockInsert Custom Block
EditorContext.insertDividerInsert Divider
EditorContext.insertImageInsert Image
EditorContext.insertTextReplace Current Selection with Text
EditorContext.redoRedo
EditorContext.removeFormatClear Styles in Current Selection
EditorContext.scrollIntoViewScroll the Editor Cursor to the Visible Area of the Window
EditorContext.setContentsInitialize Editor Content; Only Delta is Effective if Both HTML and Delta Exist
EditorContext.setSelectionSet Current Selection
EditorContext.undoUndo

Audio and Video Synthesis

API NameDescription
wx.createMediaContainerCreate an audio and video processing container, which can ultimately synthesize
MediaTrackCan be obtained via MediaContainer.extractDataSource

MediaContainer

API NameDescription
MediaContainer.addTrackAdd an audio or video track to the container
MediaContainer.destroyDestroy the container and release resources
MediaContainer.exportMerge the tracks in the container and export a video file
MediaContainer.extractDataSourceSeparate tracks from the input video source
MediaContainer.removeTrackRemove an audio or video track from the container

Real-time Voice

API NameDescription
wx.updateVoIPChatMuteConfigUpdate real-time voice mute settings
wx.subscribeVoIPVideoMembersSubscribe to video feed members
wx.setEnable1v1ChatStart a Two-Person Call
wx.onVoIPVideoMembersChangedListen for the event of changes in the video status of real-time voice call memb
wx.onVoIPChatStateChangedListen for the event of changes in room status
wx.onVoIPChatSpeakersChangedListen for the event of changes in the call status of real-time voice call membe
wx.onVoIPChatMembersChangedListen for the event of changes in the online status of real-time voice call mem
wx.onVoIPChatInterruptedListen for the event of being passively disconnected from a real-time voice call
wx.offVoIPVideoMembersChangedRemove the listener function for the event of changes in the video status of rea
wx.offVoIPChatStateChangedRemove the listener function for the event of changes in room status
wx.offVoIPChatSpeakersChangedRemove the listener function for the event of changes in the call status of real
wx.offVoIPChatMembersChangedRemove the listener function for the event of changes in the online status of re
wx.offVoIPChatInterruptedRemove the listener function for the event of being passively disconnected from
wx.joinVoIPChatJoin (Create) a real-time voice call. For more information, see Real-Time Voice
wx.join1v1ChatJoin (Create) a Two-Person Call
wx.exitVoIPChatExit (Destroy) Real-time Voice Call

Screen recorder

API NameDescription
wx.createMediaRecorderCreate a WebGL screen recorder, which can record frames rendered on WebGL and ex

MediaRecorder

API NameDescription
MediaRecorder.destroyDestroy the recorder
MediaRecorder.offCancel listening to recording events
MediaRecorder.onRegister a callback function to listen for recording events
MediaRecorder.pausePause recording
MediaRecorder.requestFrameRequest the next frame for recording; starts recording the current frame after c
MediaRecorder.resumeResume recording
MediaRecorder.startStart recording
MediaRecorder.stopEnd recording

Video Decoder

API NameDescription
wx.createVideoDecoderCreate a video decoder to retrieve decoded data frame by frame

VideoDecoder

API NameDescription
VideoDecoder.getFrameDataGet the decoded data of the next frame
VideoDecoder.offUnsubscribe from recording events
VideoDecoder.onRegister a callback function to listen to recording events
VideoDecoder.removeRemove the decoder
VideoDecoder.seekSeek to a specific time point for decoding
VideoDecoder.startStart Decoding
VideoDecoder.stopStop Decoding

Location

API NameDescription
wx.stopLocationUpdateStop listening for real-time location changes; message reception stops in both f
wx.startLocationUpdateBackgroundEnable Mini Program to receive location messages in both foreground and backgrou
wx.startLocationUpdateEnable Mini Program to receive location messages when in the foreground.
wx.openLocationView location using the built-in WeChat map.
wx.onLocationChangeErrorTriggered when the continuous location retrieval interface returns a failure.
wx.onLocationChangeListens for real-time location change events. Must be used in conjunction with w
wx.offLocationChangeErrorTriggered when the continuous location retrieval interface returns a failure.
wx.offLocationChangeRemove the listener function for real-time location change events
wx.getLocationRetrieve the current location and speed
wx.getFuzzyLocationRetrieve the current fuzzy location
wx.choosePoiOpen the POI list to select a location, supporting both fuzzy location (city-lev
wx.chooseLocationOpen the map to select a location

File

API NameDescription
wx.saveFileToDiskSave a file from the file system to the user's disk, supported only on PC
wx.openDocumentOpen a document in a new page
wx.getFileSystemManagerRetrieve the globally unique file manager
FileStatsEach FileStats object contains path and Stats
ReadResultFile read result
WriteResultFile write result

FileSystemManager

API NameDescription
FileSystemManager.accessCheck if a file/directory exists
FileSystemManager.accessSyncSynchronous version of FileSystemManager.access
FileSystemManager.appendFileAppend content to the end of a file
FileSystemManager.appendFileSyncSynchronous version of FileSystemManager.appendFile
FileSystemManager.closeClose a file
FileSystemManager.closeSyncClose a file synchronously
FileSystemManager.copyFileCopy a file
FileSystemManager.copyFileSyncSynchronous version of FileSystemManager.copyFile
FileSystemManager.fstatRetrieve the status information of a file
FileSystemManager.fstatSyncSynchronously retrieve the status information of a file
FileSystemManager.ftruncateTruncate the content of a file
FileSystemManager.ftruncateSyncTruncate the content of a file
FileSystemManager.getFileInfoRetrieve information about a local temporary file or local cached file under the
FileSystemManager.getSavedFileListRetrieve the list of local cached files saved under the specified Mini Program
FileSystemManager.mkdirCreate a directory
FileSystemManager.mkdirSyncSynchronous version of FileSystemManager.mkdir
FileSystemManager.openOpen a file and return the file descriptor
FileSystemManager.openSyncSynchronously open a file and return the file descriptor
FileSystemManager.readRead a file
FileSystemManager.readCompressedFileRead the content of a local file with the specified compression type
FileSystemManager.readCompressedFileSyncSynchronously read the content of a local file with the specified compression ty
FileSystemManager.readdirRead the list of files within a directory
FileSystemManager.readdirSyncSynchronous version of FileSystemManager.readdir
FileSystemManager.readFileRead the content of a local file
FileSystemManager.readFileSyncSynchronous version of FileSystemManager.readFile
FileSystemManager.readSyncRead a file
FileSystemManager.readZipEntryRead a file within an archive
FileSystemManager.removeSavedFileDelete a local cached file saved under the specified Mini Program
FileSystemManager.renameRename a file
FileSystemManager.renameSyncSynchronous version of FileSystemManager.rename
FileSystemManager.rmdirDelete a directory
FileSystemManager.rmdirSyncSynchronous version of FileSystemManager.rmdir
FileSystemManager.saveFileSave a temporary file locally
FileSystemManager.saveFileSyncSynchronous version of FileSystemManager.saveFile
FileSystemManager.statRetrieve the Stats object of a file
FileSystemManager.statSyncSynchronous version of FileSystemManager.stat
FileSystemManager.truncateTruncate the content of a file
FileSystemManager.truncateSyncTruncate the content of a file (synchronous version of truncate)
FileSystemManager.unlinkDelete a file
FileSystemManager.unlinkSyncSynchronous version of FileSystemManager.unlink
FileSystemManager.unzipExtract an archive file
FileSystemManager.writeWrite to a file
FileSystemManager.writeFileWrite to a file
FileSystemManager.writeFileSyncSynchronous version of FileSystemManager.writeFile
FileSystemManager.writeSyncSynchronously write to a file

Stats

API NameDescription
Stats.isDirectoryDetermine whether the current file is a directory
Stats.isFileDetermine whether the current file is a regular file

Open Interface

Login

API NameDescription
wx.pluginLoginThis API can only be called in Mini Program plugins. Invoke the API to obtain th
wx.loginCall the API to obtain the login credential (code)
wx.checkSessionCheck whether the session_key for the login state has expired

Account Information

API NameDescription
wx.getAccountInfoSyncGet current account information

User Information

API NameDescription
wx.getUserProfileGet user information
wx.getUserInfoGet user information
UserInfoUser Information

Authorization

API NameDescription
wx.authorizeForMiniProgramThis API can only be called in the Mini Program plugin, usage is the same as wx.
wx.authorizeInitiate an authorization request to the user in advance

Settings

API NameDescription
wx.openSettingLaunch the Mini Program settings interface on the client, and return the result
wx.getSettingGet the user's current settings
AuthSettingUser authorization settings; for details, refer to Permissions
SubscriptionsSettingSubscription Message Settings

Shipping Address

API NameDescription
wx.chooseAddressGet the user's shipping address

Coupons

API NameDescription
wx.openCardView coupons in the WeChat Wallet
wx.addCardAdd coupons in bulk

Invoices

API NameDescription
wx.chooseInvoiceTitleSelect the user's invoice header
wx.chooseInvoiceSelect an existing invoice from the user

Biometric Authentication

API NameDescription
wx.startSoterAuthenticationInitiate SOTER biometric authentication
wx.checkIsSupportSoterAuthenticationGet the SOTER biometric authentication methods supported by the device
wx.checkIsSoterEnrolledInDeviceAPI to check if biometric information such as fingerprints is enrolled on the de

WeChat Sports

API NameDescription
wx.shareToWeRunShare data to WeChat Sports
wx.getWeRunDataGet the user's step count from WeChat Sports over the past 31 days

Subscription Messages

API NameDescription
wx.requestSubscribeMessageLaunch the Mini Program subscription message interface on the client, and return
wx.requestSubscribeDeviceMessageSubscription device message API; invoking this displays an authorization dialog.

WeChat Red Packet

API NameDescription
wx.showRedPackageFetch the H5 red packet cover page

WeChat Store

API NameDescription
wx.openStoreOrderDetailOpen the WeChat Store order details page
wx.openStoreCouponDetailOpen the WeChat Store coupon details page
wx.getStoreTraceIdGet the WeChat Store tracking ID, used for standardized e-commerce ordering scen

Favorites

API NameDescription
wx.addVideoToFavoritesFavorite videos
wx.addFileToFavoritesFavorite files

Employment Relationship

API NameDescription
wx.requestSubscribeEmployeeMessageAfter the user has bound the Employment Relationship with this Mini Program, the
wx.checkEmployeeRelationCheck the binding relationship between the Mini Program Employment Relationship
wx.bindEmployeeRelationInvoke the Mini Program Employment Relationship feature binding dialog. If the u

My Mini Program

API NameDescription
wx.checkIsAddedToMyMiniProgramCheck whether Mini Program has been added to "My Mini Program "

Face Detection

API NameDescription
wx.requestFacialVerifyPerform biometric-based face verification for user real-name information
wx.checkIsSupportFacialRecognitionCheck whether the current device supports facial recognition capabilities

License Plate

API NameDescription
wx.chooseLicensePlateSelect a license plate number

Video Accounts

API NameDescription
wx.reserveChannelsLiveSubscribe to a Video Account live stream
wx.openChannelsUserProfileOpen the Video Account homepage
wx.openChannelsLiveNoticeInfoOpen the Video Account live stream preview half-screen
wx.openChannelsLiveOpen a Video Account live stream
wx.openChannelsEventOpen a Video Account activity page
wx.openChannelsActivityOpen a Video Account video
wx.getChannelsShareKeyGet the sharing source of a Video Account live stream card or video card. This i
wx.getChannelsLiveNoticeInfoGet Video Account live stream preview information
wx.getChannelsLiveInfoGet Video Account live stream information

Audio and Video Calls

API NameDescription
wx.requestDeviceVoIPRequest user authorization for audio and video calls with a device (group)
wx.getDeviceVoIPListQuery the audio and video call device (group) information authorized by the curr

WeChat Group

API NameDescription
wx.getGroupEnterInfoGet the Mini Program launch information in a WeChat group chat scenario

Privacy Information Authorization

API NameDescription
wx.requirePrivacyAuthorizeSimulate privacy API calls and trigger the privacy popup logic
wx.openPrivacyContractNavigate to the privacy policy page
wx.onNeedPrivacyAuthorizationListen for user authorization events required by privacy APIs
wx.getPrivacySettingQuery privacy authorization status

WeChat Customer Service

API NameDescription
wx.openCustomerServiceChatOpen WeChat Customer Service; this API can only be called after a click event oc

WeChat Emojis

API NameDescription
wx.openStickerSetViewOpen an emoji album
wx.openStickerIPViewOpen an emoji IP collection
wx.openSingleStickerViewOpen a single emoji
wx.openDesignerProfileNavigate to the Emoji Artist homepage

Device

Bluetooth - General

API NameDescription
wx.stopBluetoothDevicesDiscoveryStops scanning for nearby BLE peripheral devices
wx.startBluetoothDevicesDiscoveryStarts scanning for nearby BLE peripheral devices
wx.openBluetoothAdapterInitializes the Bluetooth module
wx.onBluetoothDeviceFoundListens for the event of discovering new devices
wx.onBluetoothAdapterStateChangeListens for the Bluetooth adapter status change event
wx.offBluetoothDeviceFoundRemoves all listener functions for the event of discovering new devices
wx.offBluetoothAdapterStateChangeRemoves all listener functions for the Bluetooth adapter status change event
wx.makeBluetoothPairPairs a Bluetooth device; only supported on Android
wx.isBluetoothDevicePairedChecks whether a Bluetooth device is paired; only supported on Android
wx.getConnectedBluetoothDevicesGets connected Bluetooth devices based on the primary service UUID
wx.getBluetoothDevicesGets all Bluetooth devices found during the active period of the Bluetooth modul
wx.getBluetoothAdapterStateGets the status of the local Bluetooth adapter
wx.closeBluetoothAdapterTurns off the Bluetooth module

Bluetooth - Low Energy Central Device

API NameDescription
wx.writeBLECharacteristicValueWrite binary data to a characteristic of a Bluetooth Low Energy device
wx.setBLEMTUNegotiate and set the Maximum Transmission Unit (MTU) for Bluetooth Low Energy
wx.readBLECharacteristicValueRead binary data from a characteristic of a Bluetooth Low Energy device
wx.onBLEMTUChangeListen for Bluetooth Low Energy Maximum Transmission Unit change events (trigger
wx.onBLEConnectionStateChangeListen for Bluetooth Low Energy connection state change events
wx.onBLECharacteristicValueChangeListen for characteristic value change events on a Bluetooth Low Energy device
wx.offBLEMTUChangeRemove the listener function for Bluetooth Low Energy Maximum Transmission Unit
wx.offBLEConnectionStateChangeRemove the listener function for Bluetooth Low Energy connection state change ev
wx.offBLECharacteristicValueChangeRemove all listener functions for characteristic value change events on a Blueto
wx.notifyBLECharacteristicValueChangeEnable the notify feature for characteristic value changes on a Bluetooth Low En
wx.getBLEMTURetrieve the Maximum Transmission Unit of a Bluetooth Low Energy device
wx.getBLEDeviceServicesRetrieve all services of a Bluetooth Low Energy device
wx.getBLEDeviceRSSIRetrieve the signal strength (Received Signal Strength Indication, RSSI) of a Bl
wx.getBLEDeviceCharacteristicsRetrieve all characteristics within a specific service of a Bluetooth Low Energy
wx.createBLEConnectionConnect to a Bluetooth Low Energy device
wx.closeBLEConnectionDisconnect from a Bluetooth Low Energy device

Bluetooth - Low Energy Peripheral Device

API NameDescription
wx.onBLEPeripheralConnectionStateChangedListens for the connection or disconnection events of the current peripheral dev
wx.offBLEPeripheralConnectionStateChangedRemoves the listener function for the connection or disconnection events of the
wx.createBLEPeripheralServerSets up a local Bluetooth Low Energy (BLE) peripheral server; multiple instances

BLEPeripheralServer

API NameDescription
BLEPeripheralServer.addServiceAdd a service
BLEPeripheralServer.closeClose the current server
BLEPeripheralServer.offCharacteristicReadRequestRemove the listener function for events where a connected device requests to rea
BLEPeripheralServer.offCharacteristicSubscribedRemove the listener function for characteristic subscription events
BLEPeripheralServer.offCharacteristicUnsubscribedRemove the listener function for characteristic unsubscription events
BLEPeripheralServer.offCharacteristicWriteRequestRemove the listener function for events where a connected device requests to wri
BLEPeripheralServer.onCharacteristicReadRequestListen for events where a connected device requests to read the characteristic v
BLEPeripheralServer.onCharacteristicSubscribedListen for characteristic subscription events (iOS only)
BLEPeripheralServer.onCharacteristicUnsubscribedListen for characteristic unsubscription events (iOS only)
BLEPeripheralServer.onCharacteristicWriteRequestListen for events where a connected device requests to write to the characterist
BLEPeripheralServer.removeServiceRemove a service
BLEPeripheralServer.startAdvertisingStart advertising a locally created peripheral device
BLEPeripheralServer.stopAdvertisingStop advertising
BLEPeripheralServer.writeCharacteristicValueWrite a binary data value to a specified characteristic and notify the connected

Bluetooth - Beacon

API NameDescription
wx.stopBeaconDiscoveryStops scanning for nearby Beacon devices
wx.startBeaconDiscoveryStarts scanning for nearby Beacon devices
wx.onBeaconUpdateListens for the Beacon device update event; only one listener can be registered
wx.onBeaconServiceChangeListens for the Beacon service status change event; only one listener can be reg
wx.offBeaconUpdateRemoves all listener functions for the Beacon device update event
wx.offBeaconServiceChangeRemoves all listener functions for the Beacon service status change event
wx.getBeaconsGets all discovered Beacon devices
BeaconInfoBeacon devices

NFC Read/Write

API NameDescription
wx.removeSecureElementPassDelete a specific card from the device
wx.rechargeTransitCardAvailable on Android only
wx.issueTransitCardAvailable on Android only
wx.getTransitCardListAvailable on Android only.
wx.getTransitCardInfoAvailable on Android only.
wx.getTransitCardCPLCAvailable on Android only.
wx.getSecureElementPassesGet information about all cards on the device.
wx.getNFCAdapterGet the NFC instance.
wx.deleteTransitCardAvailable on Android only.
wx.checkTransitCardSupportAvailable on Android only.
wx.canAddSecureElementPassDetermine whether the device supports adding this payment card.
wx.addPaymentPassGetCertificateDataInitiate the Apple Pay card addition process. Retrieve the certificate, nonce, a
wx.addPaymentPassFinishNotify the client that card addition was successful.

IsoDep

API NameDescription
IsoDep.closeDisconnect
IsoDep.connectConnect to an NFC tag
IsoDep.getHistoricalBytesGet reset information
IsoDep.getMaxTransceiveLengthGet the maximum transfer length
IsoDep.isConnectedCheck if a connection is established
IsoDep.setTimeoutSet the timeout duration
IsoDep.transceiveSend data

MifareClassic

API NameDescription
MifareClassic.closeDisconnect
MifareClassic.connectConnect to an NFC tag
MifareClassic.getMaxTransceiveLengthGet the maximum transfer length
MifareClassic.isConnectedCheck if a connection is established
MifareClassic.setTimeoutSet the timeout duration
MifareClassic.transceiveSend data

MifareUltralight

API NameDescription
MifareUltralight.closeDisconnect
MifareUltralight.connectConnect to an NFC tag
MifareUltralight.getMaxTransceiveLengthGet the maximum transfer length
MifareUltralight.isConnectedCheck if a connection is established
MifareUltralight.setTimeoutSet the timeout duration
MifareUltralight.transceiveSend data

Ndef

API NameDescription
Ndef.closeDisconnect.
Ndef.connectConnect to an NFC tag.
Ndef.isConnectedCheck if connected.
Ndef.offNdefMessageCancel listening for Ndef messages.
Ndef.onNdefMessageListen for Ndef messages.
Ndef.setTimeoutSet the timeout duration.
Ndef.writeNdefMessageRewrite the Ndef tag content.

NfcA

API NameDescription
NfcA.closeDisconnect.
NfcA.connectConnect to an NFC tag.
NfcA.getAtqaGet ATQA information.
NfcA.getMaxTransceiveLengthGet the maximum transmission length.
NfcA.getSakGet SAK information.
NfcA.isConnectedCheck if connected.
NfcA.setTimeoutSet the timeout duration.
NfcA.transceiveSend data.

NFCAdapter

API NameDescription
NFCAdapter.getIsoDepGet an IsoDep instance. The instance supports read/write operations compliant wi
NFCAdapter.getMifareClassicGet a MifareClassic instance. The instance supports read/write operations for MI
NFCAdapter.getMifareUltralightGet a MifareUltralight instance. The instance supports read/write operations for
NFCAdapter.getNdefGet the Ndef instance. The instance supports reading and writing NDEF data on ND
NFCAdapter.getNfcAGet the NfcA instance. The instance supports reading and writing based on the NF
NFCAdapter.getNfcBGet the NfcB instance. The instance supports reading and writing based on the NF
NFCAdapter.getNfcFGet the NfcF instance. The instance supports reading and writing based on the NF
NFCAdapter.getNfcVGet the NfcV instance. The instance supports reading and writing based on the NF
NFCAdapter.offDiscoveredRemove the listener function for NFC tags.
NFCAdapter.onDiscoveredListen for NFC tags.
NFCAdapter.startDiscovery-
NFCAdapter.stopDiscovery-

NfcB

API NameDescription
NfcB.closeDisconnect.
NfcB.connectConnect to an NFC tag.
NfcB.getMaxTransceiveLengthGet the maximum transmission length.
NfcB.isConnectedCheck if connected.
NfcB.setTimeoutSet the timeout duration.
NfcB.transceiveSend data.

NfcF

API NameDescription
NfcF.closeDisconnect.
NfcF.connectConnect to an NFC tag.
NfcF.getMaxTransceiveLengthGet the maximum transmission length.
NfcF.isConnectedCheck if connected.
NfcF.setTimeoutSet the timeout duration.
NfcF.transceiveSend data.

NfcV

API NameDescription
NfcV.closeDisconnect.
NfcV.connectConnect to an NFC tag.
NfcV.getMaxTransceiveLengthGet the maximum transmission length.
NfcV.isConnectedCheck if connected.
NfcV.setTimeoutSet the timeout duration.
NfcV.transceiveSend data.

Wi-Fi

API NameDescription
wx.stopWifiClose the Wi-Fi module
wx.startWifiInitialize the Wi-Fi module
wx.setWifiListSet related AP information in
wx.onWifiConnectedWithPartialInfoListen for the Wi-Fi connection event
wx.onWifiConnectedListen for the Wi-Fi connection event
wx.onGetWifiListListen for the Wi-Fi list data event
wx.offWifiConnectedWithPartialInfoRemove the listener function for the Wi-Fi connection event
wx.offWifiConnectedRemove the listener function for the Wi-Fi connection event
wx.offGetWifiListRemove the listener function for the Wi-Fi list data event
wx.getWifiListRequest to get the Wi-Fi list
wx.getConnectedWifiGet information about the connected Wi-Fi
wx.connectWifiConnect to Wi-Fi
WifiInfoWi-Fi Information

Calendar

API NameDescription
wx.addPhoneRepeatCalendarAdds a recurring event to the system calendar
wx.addPhoneCalendarAdds an event to the system calendar

Contacts

API NameDescription
wx.chooseContactOpens the phone address book to select a contact
wx.addPhoneContactAdds a contact to the phone address book

Accessibility

API NameDescription
wx.checkIsOpenAccessibilityCheck if visual accessibility features are enabled

Battery

API NameDescription
wx.onBatteryInfoChangeListen for battery information change events; currently, only monitoring the swi
wx.offBatteryInfoChangeRemove the listener function for battery information change events
wx.getBatteryInfoSyncSynchronous version of wx.getBatteryInfo
wx.getBatteryInfoRetrieve device battery information

Clipboard

API NameDescription
wx.setClipboardDataSets the content of the system clipboard
wx.getClipboardDataGets the content of the system clipboard

NFC Host Card Emulation

API NameDescription
wx.stopHCEClose the NFC module
wx.startHCEInitialize the NFC module
wx.sendHCEMessageSend an NFC message
wx.onHCEMessageListen to the NFC device message reception event
wx.offHCEMessageRemove the listener function for the NFC device message reception event
wx.getHCEStateCheck if the current device supports HCE capabilities

Network

API NameDescription
wx.onNetworkWeakChangeListen to the weak network status change event
wx.onNetworkStatusChangeListen to the network status change event
wx.offNetworkWeakChangeRemove the listener function for the weak network status change event
wx.offNetworkStatusChangeRemove the listener function for the network status change event
wx.getNetworkTypeGet the network type
wx.getLocalIPAddressGet the LAN IP address

Encryption

API NameDescription
wx.getRandomValuesGets a cryptographically secure random number

Screen

API NameDescription
wx.setVisualEffectOnCaptureSet the screen behavior during screenshots/screen recordings
wx.setScreenBrightnessSet screen brightness
wx.setKeepScreenOnSet whether to keep the screen always on
wx.onUserCaptureScreenListen for the user-initiated screenshot event
wx.onScreenRecordingStateChangedListen for the user screen recording event
wx.onGeneratePosterListen for the event where the developer needs to generate a custom poster after
wx.offUserCaptureScreenUser-initiated screenshot event
wx.offScreenRecordingStateChangedRemove the listener function for the user screen recording event
wx.offGeneratePosterEvent requiring the developer to generate a custom poster after the user takes a
wx.getScreenRecordingStateCheck if the user is recording the screen
wx.getScreenBrightnessGet screen brightness

Keyboard

API NameDescription
wx.onKeyUpListen to the Mini Program global keyup event
wx.onKeyDownListen to the Mini Program global keydown event
wx.onKeyboardHeightChangeListen to the keyboard height change event
wx.offKeyUpRemove the listener function for the Mini Program global keyup event
wx.offKeyDownRemoves the listener function for the global Mini Program keyboard key press eve
wx.offKeyboardHeightChangeRemove the listener function for the keyboard height change event
wx.hideKeyboardAfter focusing on input, textarea, etc. and the keyboard appears, calls this int
wx.getSelectedTextRangeGets the cursor position of the input field after focusing on input, textarea, e

Phone

API NameDescription
wx.makePhoneCallMake a call

Accelerometer

API NameDescription
wx.stopAccelerometerStop listening for acceleration data
wx.startAccelerometerStart listening for acceleration data
wx.onAccelerometerChangeListen for acceleration data events
wx.offAccelerometerChangeRemove the listener function for acceleration data events

Compass

API NameDescription
wx.stopCompassStops listening to compass data
wx.startCompassStarts listening to compass data
wx.onCompassChangeListens for the compass data change event
wx.offCompassChangeRemoves the listener function for the compass data change event

Device Orientation

API NameDescription
wx.stopDeviceMotionListeningStop listening for device orientation changes
wx.startDeviceMotionListeningStart listening for device orientation changes
wx.onDeviceMotionChangeListen to the device orientation change event
wx.offDeviceMotionChangeRemove the listener function for the device orientation change event

Gyroscope

API NameDescription
wx.stopGyroscopeStops listening to gyroscope data
wx.startGyroscopeStarts listening to gyroscope data
wx.onGyroscopeChangeListens for the gyroscope data change event
wx.offGyroscopeChangeRemoves the listener function for the gyroscope data change event

Memory

API NameDescription
wx.onMemoryWarningListen to the insufficient memory warning event
wx.offMemoryWarningRemove the listener function for the insufficient memory warning event

QR Code Scanning

API NameDescription
wx.scanCodeLaunch the client's scanning interface to scan a QR code

SMS

API NameDescription
wx.sendSmsLaunch the phone's SMS sending interface

Vibration

API NameDescription
wx.vibrateShortTrigger a short-duration vibration on the phone (15 ms)
wx.vibrateLongTrigger a long-duration vibration on the phone (400 ms)

AI

AI Inference

API NameDescription
wx.getInferenceEnvInfoGet the version of the general AI inference engine
wx.createInferenceSessionCreate an AI Inference Session
TensorTensor
TensorsTensors are key-value objects. The object keys are used as input/output names, a

InferenceSession

API NameDescription
InferenceSession.destroyDestroy the InferenceSession instance
InferenceSession.offErrorUnlisten to the model load failure event
InferenceSession.offLoadUnlisten to the model load completion event
InferenceSession.onErrorListen to the model load failure event
InferenceSession.onLoadListen to the model load completion event
InferenceSession.runRun inference

Visual Algorithms

API NameDescription
wx.isVKSupportCheck supported version
wx.createVKSessionCreate a vision kit session object
VKBodyAnchorHuman body anchor
VKDepthAnchordepth anchor
VKFaceAnchorFace anchor
VKHandAnchorGesture anchor
VKMarkerAnchormarker anchor
VKOCRAnchorOCR anchor
VKOSDAnchorOSD anchor
VKPlaneAnchorPlane anchor. Supported only in v2

VKCamera

API NameDescription
VKCamera.getProjectionMatrixGet projection matrix

VKFrame

API NameDescription
VKFrame.getCameraBufferGet the current frame RGBA buffer
VKFrame.getCameraJpgBufferGet the current frame JPG information buffer
VKFrame.getCameraTextureGet the current frame texture. Currently, only YUV textures are supported
VKFrame.getDepthBufferGet the depth map information buffer for each frame
VKFrame.getDisplayTransformGet the texture adjustment matrix
VKFrame.getLegSegmentBufferGet the leg segmentation information buffer for each frame. Supported from Andro

VKSession

API NameDescription
VKSession.addMarkerAdd a marker. Requires to be set to when calling wx.createVKSession
VKSession.addOSDMarkerAdd an OSD marker (one-shot detection marker). Requires to be set to when call
VKSession.cancelAnimationFrameCancel a request for an animation frame added to the schedule by requestAnimatio
VKSession.destroyDestroy the session
VKSession.detectBodyStatic image human body keypoint detection
VKSession.detectDepthDepth recognition
VKSession.detectFaceStatic image face keypoint detection
VKSession.detectHandStatic image gesture keypoint detection
VKSession.getAllMarkerGet all markers. Requires to be set to when calling wx.createVKSession
VKSession.getAllOSDMarkerGet all OSD markers. Requires to be set to when calling wx.createVKSession
VKSession.getVKFrameGet the frame object. Each call triggers a frame analysis process
VKSession.hitTestTouch detection. In v1, only a single plane is supported (i.e., after hitTest ge
VKSession.offUnlisten to session events
VKSession.onListen to session events
VKSession.removeMarkerDelete a marker. Requires to be set to when calling wx.createVKSession
VKSession.removeOSDMarkerDelete an OSD marker. Requires to be set to when calling wx.createVKSession
VKSession.requestAnimationFrameExecute on the next redraw
VKSession.runOCRStatic image OCR detection
VKSession.setDepthOccRangeUpdate the depth occlusion Occ range. Requires to be passed when calling wx.cre
VKSession.startStart the session
VKSession.stopStop the session
VKSession.update3DModeUpdate 3D recognition related configuration. Requires / / to be used when cal
VKSession.updateMaskModeSet cropping related configuration. Requires to be used when calling wx.createV
VKSession.updateOSDThresholdUpdate OSD recognition accuracy. Requires to be set to when calling wx.createV

Face Detection

API NameDescription
wx.stopFaceDetectStop face detection
wx.initFaceDetectInitialize face detection
wx.faceDetectFace detection. You must initialize it using wx.initFaceDetect before use. It is

Worker

API NameDescription
wx.createWorkerCreates a Worker thread.

Worker

API NameDescription
Worker.getCameraFrameDataRetrieves the current frame image from the camera and returns ArrayBuffer data.
Worker.onErrorListens to Worker thread error events.
Worker.onMessageListens to events where the main thread/Worker thread sends messages to the curr
Worker.onProcessKilledListens to the event where the worker thread is reclaimed by the system (after e
Worker.postMessageSends messages to the main thread/Worker thread.
Worker.terminateTerminates the current Worker thread.
Worker.testOnProcessKilledUsed to simulate the iOS ExperimentalWorker thread being reclaimed by the system

WXML

API NameDescription
wx.createSelectorQueryReturns a SelectorQuery object instance
wx.createIntersectionObserverCreates and returns an IntersectionObserver object instance

IntersectionObserver

API NameDescription
IntersectionObserver.disconnectStops listening.
IntersectionObserver.observeSpecifies the target node and starts listening for changes in the intersection s
IntersectionObserver.relativeToUses a selector to specify a node as one of the reference areas
IntersectionObserver.relativeToViewportSpecifies the page display area as one of the reference areas

MediaQueryObserver

API NameDescription
MediaQueryObserver.disconnectStops listening
MediaQueryObserver.observeStarts listening for changes in page media queries

NodesRef

API NameDescription
NodesRef.boundingClientRectAdds a query request for the layout position of a node
NodesRef.contextAdds a query request for the Context object of a node
NodesRef.fieldsRetrieves related information about a node
NodesRef.nodeRetrieves the Node instance
NodesRef.refRetrieves the Ref object for the node, which can be used to manipulate the node
NodesRef.scrollOffsetAdds a query request for the scroll position of a node

SelectionContext

API NameDescription
SelectionContext.removeSelectionClears the current selection range within the selection component
SelectionContext.selectRangeActively sets the selection range within the selection component
SelectionContext.setBaseAndExtentActively sets the start and end points of the selection range within the selecti

SelectorQuery

API NameDescription
SelectorQuery.execExecutes all requests
SelectorQuery.inChanges the selection scope of the selector to inside the custom component
SelectorQuery.selectSelects the first node matching the selector under the current page
SelectorQuery.selectAllSelects all nodes matching the selector under the current page
SelectorQuery.selectViewportSelects the display area

Third-Party Platform

API NameDescription
wx.getExtConfigSyncSynchronous version of wx.getExtConfig
wx.getExtConfigGet custom data fields from Third-Party Platform

Skyline

API NameDescription
OpenContainerAn OpenContainer instance, which can be obtained via SelectorQuery.

DraggableSheetContext

API NameDescription
DraggableSheetContext.scrollToScroll to a specified position.

Snapshot

API NameDescription
Snapshot.takeSnapshotTake a snapshot of the snapshot component subtree.

TextNode

API NameDescription
TextNode.getBoxesForRangeGet the layout box of each line within the specified text offset in the text ele

Ads

API NameDescription
wx.getShowSplashAdStatusGet the display status of the cover ad component
wx.createRewardedVideoAdCreate a rewarded video ad component
wx.createInterstitialAdCreate an interstitial ad component

InterstitialAd

API NameDescription
InterstitialAd.destroyDestroy the interstitial ad instance
InterstitialAd.loadLoad an interstitial ad
InterstitialAd.offCloseRemove the listener function for the interstitial ad close event
InterstitialAd.offErrorRemove the listener function for the interstitial ad error event
InterstitialAd.offLoadRemove the listener function for the interstitial ad load event
InterstitialAd.onCloseListen to the interstitial ad close event
InterstitialAd.onErrorListen to the interstitial ad error event
InterstitialAd.onLoadListen to the interstitial ad load event
InterstitialAd.showShow the interstitial ad

RewardedVideoAd

API NameDescription
RewardedVideoAd.destroyDestroy the rewarded video ad instance
RewardedVideoAd.loadLoad a rewarded video ad
RewardedVideoAd.offCloseRemove the listener function for the event where the user clicks the button
RewardedVideoAd.offErrorRemove the listener function for the rewarded video ad error event
RewardedVideoAd.offLoadRemove the listener function for the rewarded video ad load event
RewardedVideoAd.onCloseListen to the event where the user clicks the button
RewardedVideoAd.onErrorListen to the rewarded video ad error event
RewardedVideoAd.onLoadListen to the rewarded video ad load event
RewardedVideoAd.showShow the rewarded video ad