API Patterns
Mini Program JSAPIs follow two main patterns:Event Listening APIs
APIs prefixed withmy.on listen to system events and accept callback functions. When the event is triggered, the callback is executed.
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:Next Steps
JSAPI Reference
Complete API reference by category
JS Bridge Guide
Cross-app launch integration