npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@appboxo/capacitor-boxo-sdk

v0.2.0

Published

A capacitor wrapper over Appboxo SDK for IOS and Android.

Downloads

1,125

Readme

capacitor-boxo-sdk

A Capacitor wrapper over Appboxo SDK for IOS and Android.

Install

npm install @appboxo/capacitor-boxo-sdk
npx cap sync

API

setConfig(...)

setConfig(options: ConfigOptions) => Promise<void>

Set global configs

| Param | Type | | ------------- | ------------------------------------------------------- | | options | ConfigOptions |


openMiniapp(...)

openMiniapp(options: OpenMiniappOptions) => Promise<void>

Open miniapp with options

| Param | Type | | ------------- | ----------------------------------------------------------------- | | options | OpenMiniappOptions |


setAuthCode(...)

setAuthCode(options: { appId: string; authCode: string; }) => Promise<void>

get AuthCode from hostapp backend and send it to miniapp

| Param | Type | | ------------- | ------------------------------------------------- | | options | { appId: string; authCode: string; } |


closeMiniapp(...)

closeMiniapp(options: { appId: string; }) => Promise<void>

close miniapp by appId

| Param | Type | | ------------- | ------------------------------- | | options | { appId: string; } |


sendCustomEvent(...)

sendCustomEvent(customEvent: CustomEvent) => Promise<void>

send custom event to miniapp

| Param | Type | | ----------------- | --------------------------------------------------- | | customEvent | CustomEvent |


sendPaymentEvent(...)

sendPaymentEvent(paymentEvent: PaymentEvent) => Promise<void>

send payment event to miniapp

| Param | Type | | ------------------ | ----------------------------------------------------- | | paymentEvent | PaymentEvent |


getMiniapps()

getMiniapps() => Promise<MiniappListResult>

Get list of miniapps

Returns: Promise<MiniappListResult>


hideMiniapps()

hideMiniapps() => Promise<void>

Miniapp opens on a native screen. To show payment processing page need to hide miniapp screen. To use this function need to enable 'enableMultitaskMode: true' in Appboxo.setConfigs()


addListener('custom_event', ...)

addListener(eventName: 'custom_event', listenerFunc: (customEvent: CustomEvent) => void) => Promise<PluginListenerHandle>

When host app user logs out, it is highly important to clear all miniapp storage data.

| Param | Type | | ------------------ | ----------------------------------------------------------------------------- | | eventName | 'custom_event' | | listenerFunc | (customEvent: CustomEvent) => void |

Returns: Promise<PluginListenerHandle>


addListener('payment_event', ...)

addListener(eventName: 'payment_event', listenerFunc: (paymentEvent: PaymentEvent) => void) => Promise<PluginListenerHandle>

| Param | Type | | ------------------ | -------------------------------------------------------------------------------- | | eventName | 'payment_event' | | listenerFunc | (paymentEvent: PaymentEvent) => void |

Returns: Promise<PluginListenerHandle>


addListener('miniapp_lifecycle', ...)

addListener(eventName: 'miniapp_lifecycle', listenerFunc: (lifecycle: LifecycleEvent) => void) => Promise<PluginListenerHandle>

| Param | Type | | ------------------ | --------------------------------------------------------------------------------- | | eventName | 'miniapp_lifecycle' | | listenerFunc | (lifecycle: LifecycleEvent) => void |

Returns: Promise<PluginListenerHandle>


logout()

logout() => Promise<void>

Interfaces

ConfigOptions

| Prop | Type | Description | | ------------------------- | ------------------------------------------ | ---------------------------------------------------------------------------------------- | | clientId | string | your client id from dashboard | | userId | string | hostapp userId, will be used for the Consent Management | | language | string | language value will be passed to the miniapp | | sandboxMode | boolean | switch to sandbox mode | | enableMultitaskMode | boolean | Each miniapp appears as a task in the Recents screen. !It works only on android devices. | | theme | 'light' | 'dark' | 'system' | theme for splash screen and other native components used inside miniapp. | | isDebug | boolean | enables webview debugging | | showPermissionsPage | boolean | use it to hide "Settings" from Miniapp menu | | showClearCache | boolean | use it to hide "Clear cache" from Miniapp menu |

OpenMiniappOptions

| Prop | Type | Description | | -------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------- | | appId | string | miniapp id | | data | object | (optional) data as Map that is sent to miniapp | | theme | 'light' | 'dark' | 'system' | (optional) miniapp theme "dark" | "light" (by default is system theme) | | extraUrlParams | object | (optional) extra query params to append to miniapp URL (like: http://miniapp-url.com/?param=test) | | urlSuffix | string | (optional) suffix to append to miniapp URL (like: http://miniapp-url.com/?param=test) | | colors | ColorOptions | (optional) provide colors to miniapp if miniapp supports | | enableSplash | boolean | (optional) use to skip miniapp splash screen | | saveState | boolean | (optional) use to save state on close miniapp |

ColorOptions

| Prop | Type | | -------------------- | ------------------- | | primaryColor | string | | secondaryColor | string | | tertiaryColor | string |

CustomEvent

| Prop | Type | | --------------- | ------------------- | | appId | string | | requestId | number | | type | string | | errorType | string | | payload | object |

PaymentEvent

| Prop | Type | | ---------------------- | ------------------- | | appId | string | | transactionToken | string | | miniappOrderId | string | | amount | number | | currency | string | | status | string | | hostappOrderId | string | | extraParams | object |

MiniappListResult

| Prop | Type | | -------------- | -------------------------- | | miniapps | [MiniappData] | | error | string |

MiniappData

| Prop | Type | | ----------------- | ------------------- | | appId | string | | name | string | | category | string | | description | string | | logo | string |

PluginListenerHandle

| Prop | Type | | ------------ | ----------------------------------------- | | remove | () => Promise<void> |

LifecycleEvent

| Prop | Type | Description | | --------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | appId | string | | | lifecycle | string | onLaunch - Called when the miniapp will launch with Appboxo.open(...) onResume - Called when the miniapp will start interacting with the user onPause - Called when the miniapp loses foreground state onClose - Called when clicked close button in miniapp or when destroyed miniapp page onError - Called when miniapp fails to launch due to internet connection issues onUserInteraction - Called whenever touch event is dispatched to the miniapp page. onAuth - Called when the miniapp starts login and user allows it | | error | string | |