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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@justgold/web-sdk

v1.1.13

Published

JustGold embeddable web SDK — React iframe host and vanilla JS bridge for partner web apps

Readme

@justgold/web-sdk

Embeddable JustGold trading UI for partner web applications — React iframe host (JustGoldEmbed) and vanilla JS helper (createJustGoldHost).

| | | | ----------------- | ------------------------------------------------------------------------------------------------------------ | | Registry | npm | | Version | 1.1.13 — see CHANGELOG | | Publish | Manual — GitHub Actions | | Partner docs | Quickstart · Web guide | | Requires | @justgold/partner-sdk on your backend | | Reference app | apps/web-b2b — iframe + payment overlay demo |


Installation

yarn add @justgold/web-sdk
npm install @justgold/web-sdk

Peer dependencies (React entry only): react >= 18, react-dom >= 18


Host the UI bundle (recommended)

The trading UI ships inside this package at assets/webview/index.html. Copy it to your static assets after install / upgrade:

cp -r node_modules/@justgold/web-sdk/assets/webview public/justgold-sdk

Use sdkUrl="/justgold-sdk/index.html". Same-origin hosting is the recommended web integration — mobile SDKs use JustGold CDN instead.

Node-only helper (build scripts):

import { getBundledWebviewDir } from '@justgold/web-sdk/node';

React

import { JustGoldEmbed } from '@justgold/web-sdk';

<JustGoldEmbed
  sdkUrl="/justgold-sdk/index.html"
  session={{
    token: jwt,
    refreshToken,
    sandbox: false,
    locale: 'en',
  }}
  onClose={() => setOpen(false)}
  onAuthRequired={() => refreshToken()}
  onSessionExpired={() => refreshToken()}
  onTokensRefreshed={({ sessionToken, refreshToken }) => persist(refreshToken)}
  onSuccess={txn => console.log(txn)}
  onAnalytics={({ name, params }) => console.log(name, params)}
  onPaymentRequired={(payload, _resume) => openPaymentOverlay(payload)}
  onError={err => {
    if (err.fatal) {
      // SDK cannot load — show your UI or close
    } else {
      console.warn(err);
    }
  }}
/>;

Pass session.sandbox: true for the sandbox API — partners do not pass apiBaseUrl.

When sdkUrl is omitted, the wrapper can fetch a signed CDN URL from GET /v1/sdk/ui-url (same as mobile). For browser apps, prefer same-origin sdkUrl above.

Full-page payment (web)

Keep the iframe mounted. Show a full-screen payment overlay on top, PATCH Completed / Failed / Cancelled (Back) via HMAC, then close the overlay — the SDK polls: result or restore buy/sell. See apps/web-b2b.

resume(transactionId) via the second onPaymentRequired argument or host.sendPaymentResult(id) is optional.

If payment stays Pending for 10 minutes, JustGold marks it Stale. Do not PATCH Stale.

Session recovery (1.1.5+)

When auth fails, the embedded UI runs multi-phase recovery (retries + tab foreground auto-retry). Refresh session tokens in onAuthRequired / onSessionExpired — keep the iframe mounted. On visibilitychange back to visible, refresh again if the embed is still open.


Vanilla JS

import { createJustGoldHost } from '@justgold/web-sdk';

const host = createJustGoldHost({
  container: document.getElementById('justgold')!,
  sdkUrl: '/justgold-sdk/index.html',
  session: { token: jwt, sandbox: false },
  onClose: () => host.destroy(),
  onAnalytics: ({ name, params }) => console.log(name, params),
  onPaymentRequired: payload => {
    showPaymentOverlay(payload).then(() => hidePaymentOverlay());
    // SDK polls and shows result — resume() / host.sendPaymentResult() optional
  },
});

Environments

| Environment | Partner API | Web UI | session.sandbox | | ----------- | ---------------------------------------- | ------------------------- | ----------------- | | Sandbox | https://api.stage.partner.justgold.app | Same-origin copy from npm | true | | Production | https://api.partner.justgold.app | Same-origin copy from npm | false / omit |


Local development (monorepo)

yarn sync:postman-env
yarn dev:sdk:web

Open http://localhost:5180 — see apps/web-b2b.


Publishing (maintainers)

  1. Bump version in package.json (keep aligned with @justgold/rn-sdk / UI bundle)
  2. From repo root: yarn build:sdk (syncs assets/webview/)
  3. Actions → SDK: Publish (manual) → select @justgold/web-sdk

Scripts

| Script | Description | | ----------------------------------------- | ------------------ | | yarn workspace @justgold/web-sdk build | Compile to dist/ | | yarn workspace @justgold/web-sdk verify | typecheck + lint |