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 🙏

© 2025 – Pkg Stats / Ryan Hefner

wingbank-web-jsbridge

v0.0.2

Published

JS bridge native interface

Readme

JavaScript SDK

This package is used to communicate with the native SDKs. It’s a set of functions for requesting and receiving data. To get started, run the install command below:

npm install web-jsbridge

Basic Usage

// Common JS
const { callHandler, registerHandler, $bridge } = require("web-jsbridge");

// ES Module
import { callHandler, registerHandler, $bridge } from 'web-jsbridge';

Call Handler

This is used to request the resource from the Native Host application.

closeApp

This functions trigger the native app to close the current running Mini App.

await callHandler("closeApp", {})

getProfile

Get current profile of the user. After, the payment is made, the getStatus event will be called.

const profile = await callHandler("getProfile", {});

getDefaultAcc

Get the default account of the user.

const account = await callHandler("getDefaultAcc", {
  currency: "USD",
  amount: "1.42"
});

doPayment

Trigger the payment on the native app

await callHandler("doPayment", {
  amount: "1.42",
  currency: "USD",
  account: "12341234",
  useDefault: false, 
});

getConfig

Get information about the mini app config. Such as merchant ID or Mini App ID.

const cfg = await callHandler("getConfig", {});

openMap

Open Google Maps or Apple Maps by providing the Latitude or Longitude

await callHandler("openMap", { 
  lat: "2.1", 
  lng: "1.4"
});

share

Share content via the platform default share intent.

await callHandler("share", {
  fileName: "file.png",
  content: "base64",
  type: "image/png",
  message: "",
  trxId: "1234",
})

requestCurrentLocation

Request current location of the user. Once it’s resolved, it will trigger the requestCurrentLocation event listener.

await callHandler("requestCurrentLocation", {});

openApp

Open native application or deep link.

// open the default email app.
await callHandler('openApp', {
  name: "email",
  value: "[email protected]",
})

// phone dial
await callHandler('openApp', {
  name: "phone",
  value: "85511223344",
})

// web
await callHandler('openApp', {
  name: "website",
  value: "http://google.com",
})

// deep link
await callHandler('openApp', {
  name: "website",
  value: "tg://resolve?t=example",
})

viewAppInfo

Trigger the mini app information dialog.

await callHandler("viewAppInfo", {});

Register Handler

Listen for an event invoked by the Native Host application.

Payment Status getStatus

Once the payment is completed or failed, it will trigger to this event listener.

registerHandler('getStatus', data => {
  console.log(data)
});

Current Location requestCurrentLocation

After the current location is requested, the user might reject or grant the permission. If the permission is granted, the location information will be passed into this event listener.

registerHandler('requstCurrentLocation',  data => {
  console.log(data)
  // => { latitude: "0.0", longitude: "0.0" }
})

Close Mini App Prompt closeApp

Once the close button on the top right corner of the mini app is clicked, this listener will be invoked to show the soft closing dialog asking if user wants to leave.

registerHandler("closeApp", (data, callback) => {
  if (confirm("Are you sure") {
    callback()
  }
})