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

@vouchmark/widget-react

v1.0.0

Published

React SDK for embedding the Vouchmark KYB verification widget

Readme

@vouchmark/widget-react

React SDK for embedding the Vouchmark KYB (Know Your Business) verification widget.

Installation

npm install @vouchmark/widget-react
# or
pnpm add @vouchmark/widget-react
# or
yarn add @vouchmark/widget-react

Quick Start

Component Usage

Drop in the <VouchmarkWidget /> component to render a trigger button that opens the verification widget on click.

import { VouchmarkWidget } from "@vouchmark/widget-react";

function App() {
  return (
    <VouchmarkWidget
      widgetId="wgt_abc123"
      publicKey="pk_live_xxx"
      environment="live"
      applicant={{ email: "[email protected]", businessName: "Acme Inc" }}
      onSuccess={(result) => {
        console.log("Verification complete:", result);
      }}
      onError={(error) => {
        console.error("Widget error:", error);
      }}
    />
  );
}

Custom Trigger

Pass any React element as the trigger prop to use your own button or link.

<VouchmarkWidget
  widgetId="wgt_abc123"
  publicKey="pk_live_xxx"
  environment="live"
  trigger={<button className="my-btn">Start KYB</button>}
  onSuccess={(result) => console.log(result)}
/>

Hook Usage

Use useVouchmark() for imperative control without rendering a trigger element.

import { useVouchmark } from "@vouchmark/widget-react";

function VerifyButton() {
  const { open, close, isReady } = useVouchmark({
    widgetId: "wgt_abc123",
    publicKey: "pk_live_xxx",
    environment: "sandbox",
    onSuccess: (result) => console.log(result),
    onAbandon: () => console.log("User abandoned"),
  });

  return (
    <button onClick={open} disabled={!isReady}>
      Verify Business
    </button>
  );
}

API Reference

<VouchmarkWidget />

| Prop | Type | Required | Description | | --- | --- | --- | --- | | widgetId | string | Yes | Your Vouchmark widget ID | | publicKey | string | Yes | Your public API key | | environment | "sandbox" \| "live" | Yes | Target environment | | applicant | ApplicantInput | No | Pre-fill applicant data | | referenceId | string | No | Your internal reference ID | | sessionToken | string | No | Session token for resuming | | locale | string | No | Widget locale | | scriptSrc | string | No | Override the widget script URL (defaults to the jsDelivr CDN; set this to self-host or use the branded Vouchmark CDN) | | trigger | ReactNode | No | Custom trigger element | | autoOpen | boolean | No | Open widget on mount | | onSuccess | (applicant: ApplicantResult) => void | No | Called on successful verification | | onAbandon | () => void | No | Called when user closes widget | | onError | (error: WidgetError) => void | No | Called on error | | onStepCompleted | (step: StepResult) => void | No | Called when a step completes | | onReady | () => void | No | Called when widget is ready |

useVouchmark(config)

Returns { open, close, isReady } for imperative widget control.

Accepts the same props as <VouchmarkWidget /> except trigger, autoOpen, and onReady.

Types

All types are exported from the package:

import type {
  VouchmarkWidgetProps,
  UseVouchmarkConfig,
  UseVouchmarkReturn,
  ApplicantInput,
  ApplicantResult,
  WidgetError,
  StepResult,
} from "@vouchmark/widget-react";

License

MIT