Skip to main content
This page provides a comprehensive reference of all JSAPIs organized by category. Click on any API to view its detailed documentation.

Basic

Core APIs for version checking, feature detection, and app identification.
APIDescriptionDSLH5+
my.canIUseCheck if an API or feature is supported
my.SDKVersionGet the SDK version
my.getAppIdSyncGet the Mini Program App ID synchronously
my.getRunSceneGet the current running environment

In-App Event

APIs for handling app lifecycle events and errors.
APIDescriptionDSLH5+
my.onAppShowListen for app show events
my.offAppShowStop listening for app show events
my.onAppHideListen for app hide events
my.offAppHideStop listening for app hide events
my.onErrorListen for error events
my.offErrorStop listening for error events
my.onUnhandledRejectionListen for unhandled promise rejections
my.offUnhandledRejectionStop listening for unhandled rejections

UI

APIDescriptionDSLH5+
my.setNavigationBarSet navigation bar properties
my.showNavigationBarLoadingShow navigation bar loading indicator
my.hideNavigationBarLoadingHide navigation bar loading indicator
my.hideBackHomeHide the back to home button

Tab Bar

APIDescriptionDSLH5+
my.hideTabBarHide the tab bar
my.setTabBarStyleSet tab bar style

Route

APIDescriptionDSLH5+
my.navigateToNavigate to a new page
my.navigateBackNavigate back to previous page
my.redirectToRedirect to a page (closes current)
my.reLaunchRelaunch to a page (closes all others)
my.switchTabSwitch to a tab page

Feedback

APIDescriptionDSLH5+
my.alertShow alert dialog
my.confirmShow confirmation dialog
my.promptShow prompt dialog with input
my.showToastShow toast message
my.hideToastHide toast message
my.showLoadingShow loading indicator
my.hideLoadingHide loading indicator
my.showActionSheetShow action sheet

Pull-down Refresh

APIDescriptionDSLH5+
my.startPullDownRefreshStart pull-down refresh
my.stopPullDownRefreshStop pull-down refresh

Other UI APIs

APIDescriptionDSLH5+
my.choosePhoneContactChoose a phone contact
my.datePickerShow date picker
my.createAnimationCreate animation instance
my.createCanvasContextCreate canvas context
my.hideKeyboardHide the keyboard
my.pageScrollToScroll page to position
my.createSelectorQueryCreate selector query
my.multiLevelSelectShow multi-level selector
my.setBackgroundColorSet page background color
my.setCanPullDownEnable/disable pull-down

Media

Image

APIDescriptionDSLH5+
my.chooseImageChoose images from album or camera
my.previewImagePreview images in fullscreen
my.saveImageSave image to album
my.getImageInfoGet image information
my.compressImageCompress an image

Video

APIDescriptionDSLH5+
my.chooseVideoChoose video from album or camera

Lottie

APIDescriptionDSLH5+
my.createLottieContextCreate Lottie animation context

Storage

APIDescriptionDSLH5+
my.setStorageStore data asynchronously
my.setStorageSyncStore data synchronously
my.getStorageGet stored data asynchronously
my.getStorageSyncGet stored data synchronously
my.removeStorageRemove stored data asynchronously
my.removeStorageSyncRemove stored data synchronously
my.clearStorageClear all stored data asynchronously
my.clearStorageSyncClear all stored data synchronously

File

APIDescriptionDSLH5+
my.saveFileSave file to local storage
my.getFileInfoGet file information
my.getSavedFileInfoGet saved file information
my.getSavedFileListGet list of saved files
my.removeSavedFileRemove a saved file
my.chooseFileFromDiskChoose file from disk
my.openDocumentOpen a document

Location

APIDescriptionDSLH5+
my.getLocationGet current location
my.openLocationOpen location in map
my.chooseLocationChoose a location on map

Map

APIDescriptionDSLH5+
my.createMapContextCreate map context
my.calculateRouteCalculate route between points

Network

APIDescriptionDSLH5+
my.requestMake HTTP request
my.uploadFileUpload file
my.downloadFileDownload file
my.connectSocketCreate WebSocket connection
my.sendSocketMessageSend WebSocket message
my.closeSocketClose WebSocket connection
my.onSocketOpenListen for WebSocket open
my.offSocketOpenStop listening for WebSocket open
my.onSocketMessageListen for WebSocket messages
my.offSocketMessageStop listening for WebSocket messages
my.onSocketErrorListen for WebSocket errors
my.offSocketErrorStop listening for WebSocket errors
my.onSocketCloseListen for WebSocket close
my.offSocketCloseStop listening for WebSocket close

Device

System & Network

APIDescriptionDSLH5+
my.getSystemInfoGet system information
my.getNetworkTypeGet network type

Clipboard

APIDescriptionDSLH5+
my.getClipboardGet clipboard content
my.setClipboardSet clipboard content

Sensors

APIDescriptionDSLH5+
my.onAccelerometerChangeListen for accelerometer changes
my.offAccelerometerChangeStop listening for accelerometer
my.onCompassChangeListen for compass changes
my.offCompassChangeStop listening for compass
my.watchShakeWatch for device shake

Phone & Screen

APIDescriptionDSLH5+
my.makePhoneCallMake a phone call
my.vibrateVibrate the device
my.vibrateShortTrigger a short vibration
my.vibrateLongTrigger a long vibration
my.setKeepScreenOnKeep screen on
my.getScreenBrightnessGet screen brightness
my.setScreenBrightnessSet screen brightness
my.getScreenOrientationGet screen orientation
my.setScreenOrientationSet screen orientation
my.onUserCaptureScreenListen for screenshots
my.offUserCaptureScreenStop listening for screenshots

Settings & Permissions

APIDescriptionDSLH5+
my.getSettingGet user settings
my.openSettingOpen settings page
my.showAuthGuideShow permission guide

Other Device APIs

APIDescriptionDSLH5+
my.addPhoneContactAdd phone contact
my.scanScan QR/barcode
my.onMemoryWarningListen for memory warnings
my.offMemoryWarningStop listening for memory warnings
my.getBatteryInfoGet battery info asynchronously
my.getBatteryInfoSyncGet battery info synchronously

Bluetooth

APIDescriptionDSLH5+
my.openBluetoothAdapterInitialize Bluetooth adapter
my.closeBluetoothAdapterClose Bluetooth adapter
my.getBluetoothAdapterStateGet Bluetooth adapter state
my.startBluetoothDevicesDiscoveryStart discovering devices
my.stopBluetoothDevicesDiscoveryStop discovering devices
my.getBluetoothDevicesGet discovered devices
my.getConnectedBluetoothDevicesGet connected devices
my.connectBLEDeviceConnect to BLE device
my.disconnectBLEDeviceDisconnect BLE device
my.getBLEDeviceServicesGet BLE device services
my.getBLEDeviceCharacteristicsGet BLE characteristics
my.readBLECharacteristicValueRead BLE characteristic
my.writeBLECharacteristicValueWrite BLE characteristic
my.notifyBLECharacteristicValueChangeEnable BLE notifications

Biometric Authentication

APIDescriptionDSLH5+
my.checkLocalBioAuthSupportedCheck biometric support
my.startLocalBioAuthStart biometric authentication

Sharing

APIDescriptionDSLH5+
my.showSharePanelShow share panel

Update

APIDescriptionDSLH5+
my.getUpdateManagerGet update manager instance

web-view

APIDescriptionDSLH5+
my.createWebViewContextCreate WebView context

Alipay Connect

APIDescriptionDSLH5+
my.getSiteInfoGet site information

Open Capabilities

APIDescriptionDSLH5+
my.getAuthCodeGet authorization code
my.getOpenUserInfoGet user information
my.tradePayTrigger payment
my.signContractSign contract
my.navigateToMiniProgramNavigate to another Mini Program
my.navigateBackMiniProgramNavigate back to previous Mini Program