🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

gap-miniapp-sdk

Package Overview
Dependencies
Maintainers
5
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gap-miniapp-sdk

To install the `gap-miniapp-sdk` package, run the following command:

latest
npmnpm
Version
1.0.102
Version published
Weekly downloads
69
-66.18%
Maintainers
5
Weekly downloads
 
Created
Source

GAP MiniApp SDK Usage Guide

Installation

To install the gap-miniapp-sdk package, run the following command:

npm install gap-miniapp-sdk

Initialization

  • Import and initialize the SDK in your JavaScript or TypeScript application, preferring a Singleton object to communicate with the super app:

    import { GapMiniAppSdk } from 'gap-miniapp-sdk';
    
    const gapMiniAppSdk = new GapMiniAppSdk();
    
  • Detect the platform on which the super app is running for the mini app to function correctly:

    let userAgent = gapMiniAppSdk.detectPlatform();
    gapMiniAppSdk.setPlatformExecutor(userAgent);
    

Usage

Example Functions Using the SDK

  • Get the super app's current authentication information:

    const response = await gapMiniAppSdk.getInstance().getAccessToken();
    
  • Set/Get storage item in the super app (This storage is constant and separate for each app and can be publicable):

    • Set a storage item:

      let data = {
        key: "test_key_1",
        value: { data: false },
        isPublic: 0
      };
      gapMiniAppSdk.setStorageItem(data).then((res) => console.log(res));
      
    • Get a storage item:

      let data = {
        key: "test_key_1"
      };
      await gapMiniAppSdk.getStorageItem(data)
        .then((res) => {
          console.log(res);
        })
        .catch((e) => {
          console.log(e);
        });
      

Full Functions

For a complete list of available functions, refer to the following interface file that defines each request/response type:

/gap-miniapp-sdk/dist/interface/gap_miniapp_interface

FAQs

Package last updated on 17 Nov 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts