js-miniapp-sdk

Globals / MiniAppUtilsProvider

Interface: MiniAppUtilsProvider

Mini App Utility methods

Hierarchy

Index

Methods

Methods

canOpenAppDeeplink(deeplinkURL: string): Promise<boolean>

Defined in js-miniapp-sdk/src/modules/utils.ts:56

Interface to check if the device has the deeplink available.

Parameters:

Name Type
deeplinkURL string

Returns: Promise<boolean>


closeMiniApp

closeMiniApp(withConfirmation: boolean): Promise<string>

Defined in js-miniapp-sdk/src/modules/utils.ts:24

Mini App can be closed using this method, provided Host app is supporting this interface to close the miniapp.

Parameters:

Name Type Description
withConfirmation boolean boolean value which will be used by the host app to show/hide close confirmation alert which should be set using setCloseAlert method in prior before calling this interface

Returns: Promise<string>


getFeatureList

getFeatureList(): Promise<string[]>

Defined in js-miniapp-sdk/src/modules/utils.ts:51

Interface to get list of features supported by the SDK and Host

Returns: Promise<string[]>


getHostAppThemeColors

getHostAppThemeColors(): Promise<HostThemeColor>

Defined in js-miniapp-sdk/src/modules/utils.ts:35

Interface that is used to get the Color theme used in the Host application

Returns: Promise<HostThemeColor>


isAppDeeplinkSupported

isAppDeeplinkSupported(deeplinkURL: string): Promise<boolean>

Defined in js-miniapp-sdk/src/modules/utils.ts:61

Interface to check if the application has whitelisted the deeplink

Parameters:

Name Type
deeplinkURL string

Returns: Promise<boolean>


isDarkMode

isDarkMode(): Promise<boolean>

Defined in js-miniapp-sdk/src/modules/utils.ts:40

Interface to check if the Device/Application is using Dark mode

Returns: Promise<boolean>


launchExternalBrowser

launchExternalBrowser(url: string): Promise<boolean>

Defined in js-miniapp-sdk/src/modules/utils.ts:67

This interface will be used to launch the URL in external browser

Parameters:

Name Type Description
url string Remote URL

Returns: Promise<boolean>


launchInternalBrowser

launchInternalBrowser(url: string): Promise<boolean>

Defined in js-miniapp-sdk/src/modules/utils.ts:73

This interface will be used to launch the URL in Internal browser

Parameters:

Name Type Description
url string Remote URL

Returns: Promise<boolean>


logEvent

logEvent(message: string, type: LogType): Promise<boolean>

Defined in js-miniapp-sdk/src/modules/utils.ts:80

Interface to log events with a message and log type.

Parameters:

Name Type Description
message string The log message.
type LogType The log type.

Returns: Promise<boolean>


miniAppFinishedLoading

miniAppFinishedLoading(): Promise<string>

Defined in js-miniapp-sdk/src/modules/utils.ts:30

Miniapp can notify the host app that it has finished loading using this call. Host app can implement this interface to perform any other actions after the miniapp has loaded.

Returns: Promise<string>


sendAnalytics

sendAnalytics(analytics: MAAnalyticsInfo): Promise<string>

Defined in js-miniapp-sdk/src/modules/utils.ts:46

Interface to send analytics to Host app

Parameters:

Name Type
analytics MAAnalyticsInfo

Returns: Promise<string>


setCloseAlert

setCloseAlert(alertInfo: CloseAlertInfo): Promise<string>

Defined in js-miniapp-sdk/src/modules/utils.ts:17

Mini App can choose whether to display Close confirmation alert dialog when mini app is closed

Parameters:

Name Type Description
alertInfo CloseAlertInfo CloseAlertInfo object

Returns: Promise<string>