Installation
The SDK is automatically injected by the Giftme app when your page loads inside the MiniStore WebView. No manual installation or script tags required.
Waiting for the SDK
Your JavaScript may execute before the SDK is fully ready. Use the onGiftmeReady helper to safely queue code until the SDK is available.
The helper passes the SDK directly to your callback once it's ready.
Minified Snippet
Add this inline script before your application code. Safe for multiple injections:
<script>
!function(w,d){if(w._giftmeReady)return;var c=[],r=0;w._giftmeReady=1;function f(){if(r||!w.MiniStoreSDK)return;r=1;var s=w.MiniStoreSDK;c.forEach(function(cb){try{cb(s)}catch(_){}});c.length=0}w.onGiftmeReady=function(fn){if(!fn)return;r?fn(w.MiniStoreSDK):c.push(fn)};(w.giftme_jsbridge||w.flutter_inappwebview)&&w.MiniStoreSDK?f():(d.addEventListener('giftme_jsbridgeReady',f),w.addEventListener('flutterInAppWebViewPlatformReady',f))}(window,document);
</script>
Usage
The callback receives the SDK as its argument:
window.onGiftmeReady((sdk) => {
if (sdk.isMiniStoreContext()) {
// Safe to use SDK functions here
sdk.giftmeMakePayment({ orderToken: 'ORDER_TOKEN' });
}
});
Or with destructuring:
window.onGiftmeReady(({ giftmeMakePayment, isMiniStoreContext }) => {
if (isMiniStoreContext()) {
giftmeMakePayment({ orderToken: 'ORDER_TOKEN' });
}
});