Skip to main content
The framework provides developers with JSAPI and OpenAPI capabilities to launch diversified convenient services to users. This section covers the client-side JavaScript APIs (JSAPI) that Mini Apps can use to interact with the platform and device features.

API Patterns

Mini Program JSAPIs follow two main patterns:

Event Listening APIs

APIs prefixed with my.on listen to system events and accept callback functions. When the event is triggered, the callback is executed.
Always clean up event listeners when they’re no longer needed, such as in page onUnload lifecycle hooks, to prevent memory leaks.

Standard Interface APIs

Most other APIs accept an object as a parameter and support three callback types:

Promise Support

APIs also return Promise objects, allowing both callback and async/await patterns:

API Categories

Basic

Core APIs for version checking and feature detection

In-App Event

App lifecycle and error event handling

UI

Navigation, feedback, dialogs, and UI controls

Media

Image, video, and animation handling

Storage

Local data persistence

File

File system operations

Location

Geolocation services

Map

Map integration and routing

Network

HTTP requests and WebSocket connections

Device

Hardware and system information

Sharing

Content sharing capabilities

Update

App update management

web-view

WebView integration

Open Capabilities

Authentication, payments, and cross-app navigation

Feature Detection

Before using an API, you can check if it’s supported in the current environment:
Always use feature detection for APIs that may not be available on all platform versions. This ensures your Mini App degrades gracefully on older versions.

Next Steps

JSAPI Reference

Complete API reference by category

JS Bridge Guide

Cross-app launch integration