@hipaymn/miniapp-sdk
v1.0.4
Published
Hipay MiniApp SDK – A global bridge for building MiniApps in the Hipay SuperApp ecosystem.
Downloads
250
Maintainers
Readme
@hipaymn/miniapp-sdk
Hipay MiniApp SDK – A global JavaScript bridge for building MiniApps in the Hipay SuperApp ecosystem. Provides a clean, Promise-based API for MiniApps to communicate with the native container, such as payments, navigation, and device features.
Installation
npm install @hipaymn/miniapp-sdkor
yarn add @hipaymn/miniapp-sdkUsage
Named Imports
import { pay, navigate, back } from "@hipaymn/miniapp-sdk";
await pay("checkout_123");
navigate("Home", { from: "checkout" });
back();Default Import
import wallet from "@hipaymn/miniapp-sdk";
await wallet.pay("checkout_123");
wallet.navigate("Home");
wallet.back();API Reference
pay(checkoutId: string)
Initiates a payment in the Hipay container.
await wallet.pay("checkout_123");navigate(screen: string, params?: object)
Navigate to a specific screen in the Hipay container.
await wallet.navigate("Home", { from: "checkout" });back()
Navigates back to the previous screen in the container.
await wallet.back();MiniApp Requirements
- Must run inside the Hipay SuperApp WebView container.
HPSNativebridge is injected automatically before MiniApp scripts run.- Using this SDK outside the container will throw errors.
Contributing
- Fork the repository
- Run
npm install - Make your changes in
src/ - Run
npm run build - Submit a pull request
License
MIT © Hipay LLC
