The Super Qi framework provides developers with comprehensive JSAPI capabilities to build diversified and convenient services for users. JSAPIs are client-side JavaScript functions that Mini Programs call directly within the application to access device features, user data, and platform services.
Mini Programs launched to different native apps run on different containers, which may support varying JSAPI implementations. To resolve this, Super Qi provides a JavaScript Bridge (JS Bridge) that standardizes JSAPI calls across different platforms.

JS Bridge acts as a two-way communication channel between JavaScript code in your Mini Program and native code in the host application. This allows:
To use Mini Program JSAPIs, you need to integrate the JSBridge SDK.
Add the following script tag to your Mini Program's HTML file:
<script src="https://cdn.marmot-cloud.com/npm/hylid-bridge/2.10.0/index.js"></script>
my.getAuthCode, my.tradePay, my.alert, and more which are found under the "Essential APIs" section.Super Qi JSAPIs follow consistent naming and usage patterns to make integration straightforward.
JSAPIs use different prefixes based on their purpose:
| Prefix | Purpose | Example |
|---|---|---|
my.* | Standard synchronous or callback-based APIs | my.alert(), my.httpRequest() |
AlipayJSBridge.call | Special bridge calls for certain features | AlipayJSBridge.call('qicardSignContract') |
All other JSAPI interfaces accept an object as a parameter with the following common properties:
| Property | Type | Required | Description |
|---|---|---|---|
success | Function | No | Callback executed when the API call succeeds |
fail | Function | No | Callback executed when the API call fails |
complete | Function | No | Callback executed after success or failure |
Additional API-specific properties vary depending on the functionality.
error or errorMessage fields, the call failedAll standard APIs return a Promise object, allowing you to use modern async/await syntax or promise chaining.
Callback Example:
my.httpRequest({
url: '/api/data',
success(res) {
console.log('Success:', res.data);
},
fail(res) {
console.log('Error:', res.error, res.errorMessage);
},
complete(res) {
console.log('Request completed');
}
});
Promise Example:
my.httpRequest({
url: '/api/data',
success(res1) {
console.log('Callback result:', res1);
}
}).then((res2) => {
// res1 === res2
console.log('Promise result:', res2.data);
}).catch((res) => {
console.log('Error:', res.error, res.errorMessage);
});
Async/Await Example:
async function fetchData() {
try {
const res = await my.httpRequest({ url: '/api/data' });
console.log('Data:', res.data);
} catch (res) {
console.log('Error:', res.error, res.errorMessage);
}
}
Each JSAPI has a TypeScript-style interface definition that describes its parameters and callbacks.
my.alertThe my.alert API displays a simple alert dialog. Here's how its interface is defined:
interface IAlertOptions {
title?: string; // Alert dialog title
content?: string; // Alert dialog content
buttonText?: string; // Button label text
success?: () => void; // Success callback
fail?: () => void; // Failure callback
complete?: () => void; // Completion callback
}
Usage:
my.alert({
title: 'Payment Successful',
content: 'Your order has been confirmed',
buttonText: 'OK',
success() {
console.log('User closed the alert');
}
});
Most JSAPIs follow this pattern:
interface IApiOptions {
// API-specific required parameters
requiredParam: string;
// API-specific optional parameters
optionalParam?: number;
// Common callback functions
success?: (res: SuccessResult) => void;
fail?: (res: ErrorResult) => void;
complete?: (res: Result) => void;
}
Properties marked with ? are optional.