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

@stubvia/checkout-react

v0.1.0

Published

Embedded Stubvia checkout iframe component for React apps

Readme

@stubvia/checkout-react

Embedded Stubvia checkout for web React apps (iframe + postMessage).

App nativo (React Native, Flutter): use uma WebView nativa com ?webview=1 na URL do checkout e intercepte o deep link de retorno pós-compra. Este pacote não roda em React Native (depende de iframe no DOM). Ver Integração via API — Checkout in-app no site Stubvia.

Integration modes

| | Web (this package) | Native app (WebView) | | --- | --- | --- | | URL param | embed=1&parentOrigin=https://your-site.com | webview=1 | | StubVia config | checkoutEmbedOrigins allowlist | checkoutReturnUrlAllowlist (deep link) | | Parent communication | postMessage (ready, paid, error) | Intercept return deep link navigation | | Branding | checkoutEmbedBranding | Same checkoutEmbedBranding |

Both in-app modes hide the Stubvia site header and show optional org branding plus a Powered by Stubvia footer.

Install

npm install @stubvia/checkout-react

Prerequisites

  1. Create the event in Stubvia and obtain event.checkoutUrl (or a signed checkout link).
  2. In Stubvia dashboard → Área do desenvolvedorCheckout embutido, add your site origin (e.g. https://app.exemplo.com).
  3. For integrator-linked events, use a signed checkout URL (buildSignedCheckoutUrl from @stubvia/client).

Usage

import { StubviaCheckout } from "@stubvia/checkout-react";

export function BuyTicket({ checkoutUrl }: { checkoutUrl: string }) {
  return (
    <StubviaCheckout
      checkoutUrl={checkoutUrl}
      parentOrigin="https://app.exemplo.com"
      onReady={() => console.log("checkout ready")}
      onPaid={({ orderId }) => console.log("paid", orderId)}
      onError={({ message, code }) => console.error(code, message)}
      height={760}
    />
  );
}

Events

| Callback | When | | --- | --- | | onReady | Checkout iframe loaded and ready | | onPaid | Pix payment confirmed (orderId) | | onError | Validation, embed allowlist, or checkout error | | onCancelled | Reserved for future explicit cancel UX |

Messages use postMessage with source: "stubvia-checkout". The component validates event.origin against the checkout URL host.

Branding (v2)

Configure in Stubvia dashboard → Checkout embutido (applies to iframe embed and native webview=1):

  • Logo URL (HTTPS) shown above the ticket
  • Primary color (#RRGGBB) for sidebar, borders and buttons
  • Font (sans, serif, or system)

The footer Powered by Stubvia always remains. Full white-label is a future plan tier.

Via API:

PATCH /api/v1/organization/integrator
{
  "checkoutEmbedBranding": {
    "logoUrl": "https://cdn.exemplo.com/logo.png",
    "primaryColor": "#2563eb",
    "fontFamily": "sans"
  }
}

Without React

Append embed params manually:

import { appendCheckoutEmbedParams } from "@stubvia/checkout-react";

const iframeSrc = appendCheckoutEmbedParams(checkoutUrl, "https://app.exemplo.com");

Listen for { source: "stubvia-checkout", type: "paid", orderId } on window.message.

Native WebView (not this package)

Append webview=1 to the signed checkout URL before loading it in a native WebView:

const url = new URL(signedCheckoutUrl);
url.searchParams.set("webview", "1");
// load url.toString() in WebView; intercept myapp://…?paid=1 on navigation

Configure checkoutReturnUrlAllowlist with your post-purchase deep link template.

Webhooks

Use order.paid webhooks (@stubvia/client) as the source of truth for backend sync. Iframe callbacks are for immediate UI updates in the parent page. The same applies to native apps after intercepting the return deep link.