Overview
The Features module on the Mini Program platform serves as the central hub for capability expansion and JavaScript API (JSAPI) management.
By adding different features, your mini program can unlock more JSAPIs and deliver richer user experiences.
This topic provides an overview of the Features module on the Mini Program platform.
What is a feature?
A feature is a modular capability package that can be associated with one or more JSAPIs. Once a feature is added to a mini program, the mini program can call the corresponding JSAPIs to implement specific business functions.
A JSAPI is a single, specific capability that a mini program can call to use a native device function or a platform service. For more information about JSAPIs, see Overview.
Benefits
The Features module transforms how you build, scale, and innovate. By decoupling functionality into reusable and manageable units, various benefits are delivered.
- Independent lifecycle: Each feature has its own lifecycle. This isolates changes, simplifies debugging, and different features are decoupled.
- Enhanced security: You can restrict feature access to authorized mini programs only, ensuring sensitive data remains protected.
- Rich native capabilities via JSAPIs: Add new JSAPIs to features to enrich the native capabilities.
- Clear governance: Manage all features in a centralized manner to ensure compliance with security and business policies.
Key capabilities
The Features module provides various capabilities.
- Capability mounting (JSAPI extension): Bind specific JSAPIs to a mini program.
- Lifecycle management: Create, configure, edit, and delete features throughout the lifecycle.
- Permission and access control: Define which mini programs are allowed to use specific features, ensuring that:
- Sensitive JSAPIs are not exposed by default.
- Access is auditable and controlled.
- Capability usage complies with security and business policies.
- Seamless orchestration. Align native capabilities with different business requirements by defining how and by whom they are accessed.
Typical workflow
Managing features is intuitive and fits naturally into your development cycle. The following items list the typical workflow.
- Configure a feature: Configure the related JASPIs that you want to add to the feature and then add the JSAPIs to a feature.
- (Optional) Grant permissions: Authorize mini programs to use the feature.
- Call the JSAPIs in code: Call the JSAPIs in code.
- Develop & test: Build and test the JSAPIs in mini programs.
- Deploy: Release mini programs.
- Monitor & optimize: Track performance metrics and adjust the feature based on monitoring data.