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

kyc-widget

v1.4.16

Published

KYC Widget Application

Readme

KYC Widget

Configuration Options

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | scenarioId | string | Yes | - | Unique scenario identifier from "KYC/AML" section in personal account | | clientKey | string | Yes | - | Client key, any string up to 36 characters | | clientUser | string | No | - | Any parameter at the client's discretion, max 36 characters | | isOpen | boolean | Yes* | - | Widget visibility state (*only for React component) | | debug | boolean | No | false | Debug mode | | theme | "light" \| "dark" | No | "dark" | Widget theme | | stickySession | boolean | No | false | Use sticky sessions (user redirected to active session regardless of clientKey) | | closeCb | function | No | - | Callback triggered when the widget is closed | | successCb | function | No | - | Callback triggered upon successful verification | | topOffset | number | No | 0 | Top padding in pixels | | bottomOffset | number | No | 0 | Bottom padding in pixels |

1. Example of Integration in a JavaScript Application via Script Tag (index.html)

  1. Define a button with initial loading state.
  2. Load the script dynamically and enable the button when ready.
  3. Call window.KYCWidget.setupKYC() on button click.

File: index.html

  <body>
    <button id="btn" disabled>Loading...</button>

    <script>
      const btn = document.getElementById("btn");

      const script = document.createElement("script");
      script.src = "https://kyc.enface.ai/lib/widget-lib.js";
      script.onload = () => {
        btn.disabled = false;
        btn.textContent = "Open KYC Widget";
      };
      document.body.appendChild(script);

      const openWidget = () => {
        window.KYCWidget.setupKYC({
          scenarioId: "SCENARIO_ID",
          clientKey: "CLIENT_KEY",
          clientUser: "CLIENT_USER",
          debug: true,
          theme: "light",
          stickySession: true,
          topOffset: 0,
          bottomOffset: 0,
          closeCb: () => {},
          successCb: (sessionJsonValue) => {}
        });
      };

      btn.addEventListener("click", openWidget);
    </script>
  </body>

2. Example of Integration in a React Application via NPM Package

  1. Install the npm package: npm i kyc-widget.
  2. Import it into the application: import { KycWidget } from "kyc-widget".
  3. Define a state variable to control the widget's visibility.
  4. Pass props to the KycWidget component (see Configuration Options above).

File: App.js

import { useState } from "react";
import { KycWidget } from "kyc-widget";

function App() {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <>
      <button onClick={() => setIsOpen(true)}>Open</button>

      <KycWidget
        scenarioId="SCENARIO_ID"
        clientKey="CLIENT_KEY"
        clientUser="CLIENT_USER"
        isOpen={isOpen}
        stickySession={true}
        debug={true}
        theme="light"
        topOffset={0}
        bottomOffset={0}
        closeCb={() => setIsOpen(false)}
        successCb={(sessionJsonValue) => {}}
      />

    </>
  );
}

export default App;

3. Example of Integration in a React Application via Script Tag

Use this method if you cannot install the npm package and need to load the widget via script.

  1. Load the widget script dynamically in useEffect.
  2. Track loading state with useState.
  3. Show the button only after the script is loaded.
  4. Call window.KYCWidget.setupKYC() on button click.

File: App.js

import { useState, useEffect, useCallback } from "react";

function App() {
  const [widgetLoaded, setWidgetLoaded] = useState(false);

  const openWidgetHandler = () => {
    window.KYCWidget.setupKYC({
      scenarioId: "SCENARIO_ID",
      clientKey: "CLIENT_KEY",
      clientUser: "CLIENT_USER",
      debug: true,
      theme: "light",
      topOffset: 0,
      bottomOffset: 0,
      closeCb: () => console.log("CLOSE CALLBACK"),
      successCb: (payload) => console.log("SUCCESS CALLBACK", payload),
    });
  };

  const loadWidgetScript = useCallback(() => {
    const widgetScript = document.getElementById("kyc-widget-script-id");
    if (widgetScript) return;

    const script = document.createElement("script");
    script.id = "kyc-widget-script-id";
    script.src = 'https://kyc.enface.ai/lib/widget-lib.js';
    script.defer = true;
    script.crossOrigin = "anonymous";

    script.onload = () => {
      setWidgetLoaded(true);
    };

    document.head.appendChild(script);
  }, []);

  useEffect(() => {
    if (window.KYCWidget) {
      setWidgetLoaded(true);
      return;
    }

    loadWidgetScript();
  }, [loadWidgetScript]);

  return (
    <>
      {widgetLoaded && (
        <button onClick={openWidgetHandler}>Open KYC Widget</button>
      )}
    </>
  );
}

export default App;

4. Verification via Link

To complete the verification process, you can use the service at https://kyc.enface.ai

By following the link below, a session is created:

  https://kyc.enface.ai/scenarioId/clientKey
  • scenarioId: A unique scenario identifier, which must be obtained in the user’s personal account under the "KYC/AML" section.
  • clientKey: A client key, which is any string up to 36 characters long, defined by the client according to their business logic.