Development

Quickstart

Miniapp Frontend development

After creating your miniapp and creating your merchant account and linking the two as described in the documentation, you will be able to obtain the auth code.

Project Setup

NodeJS

For Node projects, use the following npm package

npm i hylid-bridge

Pure HTML

For quick testing or simple lightweight Miniapps, you can include the following cdn in your html file's head

<script src="https://cdn.marmot-cloud.com/npm/hylid-bridge/2.10.0/index.js"></script>

Auth Flow

This page describes the first half of the flow

my.getAuthCode

The Auth code is the starting point of the integration between your system and SuperQi.

After setting up the project accordingly, you can obtain the auth code by calling the following function

my.getAuthCode({
    scopes: ['auth_base', 'USER_ID'],
    success: (res) => {
        // send the res.authCode to your backend, and exchange it for an auth token
        console.log(res.authCode);
    },
    fail: (res) => {
        // handle the error accordingly
        my.alert({
            content: res.authErrorScopes,
        });
    },
});
Backend flow can be found here

Auth Scope

The possible auth scopes, keep in mind that the required auth scopes must be selected when requesting a merchant account

ScopeDescriptionSilent Authorization
auth_baseAuthorized to obtain the unique user ID.Yes
USER_IDAuthorized to obtain the unique user ID.Yes
USER_LOGIN_IDAuthorized to obtain the user's login ID.Yes
HASH_LOGIN_IDAuthorized to obtain the hash user login ID.Yes
auth_userAuthorized to obtain the basic user information.No
USER_NAMEAuthorized to obtain the user name.No
USER_AVATARAuthorized to obtain the user avatar.No
USER_GENDERAuthorized to obtain the user's gender.No
USER_BIRTHDAYAuthorized to obtain the user's birthday.No
USER_NATIONALITYAuthorized to obtain the user's nationality.No
USER_CONTACTINFOAuthorized to obtain the user's contact information.No
NOTIFICATION_INBOXAuthorized to send notification to user's notification in app inbox.No
AGREEMENT_PAYAuthorized to debit payment from user's balance or card.No
CARD_LISTAuthorized to fetch the user's cards listNo

Example

You can find a complete implementation sample here