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

@indicina1/decide-sdk

v1.4.2

Published

The Decide Widget SDK allows you to easily integrate identity verification and spooling flows into your web application.

Readme

Decide Widget SDK

The Decide Widget SDK allows you to easily integrate identity verification and spooling flows into your web application.

Installation

npm install @indicina1/decide-sdk

CDN / Script Tag

If you prefer not to use a package manager, you can include the SDK directly via a script tag. Using this method, the SDK as exposed as a global DecideWidget object.

<script src="https://uploads.indicina.co/public/decide/prod/spool/sdk/widget.min.js"></script>

<!-- Popup Mode -->
<script>
  const controller = DecideWidget.popup({
    widgetUrl: "https://your-decide-app.com/widgets/application/...",
    customerIdentifier: "customer-123",
  });

  controller.open();
</script>

<!-- Inline Mode -->
<div id="widget-container"></div>
<script>
  DecideWidget.renderInline({
    widgetUrl: "https://your-decide-app.com/widgets/application/...",
    containerId: "widget-container", // Must match the ID above
    customerIdentifier: "customer-123",
  });
</script>

Usage

Popup Mode

import { DecideWidget } from "@indicina1/decide-sdk";

const controller = DecideWidget.popup({
  widgetUrl: "https://your-decide-app.com/widgets/application/...",
  customerIdentifier: "customer-123",
  onLoad: () => {
    console.log("Widget loaded");
  },
  onMessage: (message) => {
    console.log("Message from widget:", message);
  },
  onClose: () => {
    console.log("Widget closed");
  },
  onError: (error) => {
    console.error("Widget error:", error);
  },
});

controller.open();

Inline Mode

import { DecideWidget } from "@indicina1/decide-sdk";

DecideWidget.renderInline({
  widgetUrl: "https://your-decide-app.com/widgets/application/...",
  containerId: "widget-container",
  customerIdentifier: "customer-123",
  onLoad: () => {
    console.log("Inline widget loaded");
  },
});

Configuration

The popup and renderInline methods accept a configuration object with the following properties:

| Property | Type | Required | Description | |----------|------|----------|-------------| | widgetUrl | string | Yes | The full URL of the Decide widget application you want to load. | | customerIdentifier | string | No | A unique identifier for the customer (e.g., email or UUID). Used to pre-fill or link sessions. | | containerId | string | Yes (Inline only) | The ID of the HTML element where the widget should be rendered. | | workflowConfiguration | object | No | Optional settings to override workflow behavior. See below. | | metadata | object | No | Additional JSON data to pass to the widget session. | | autoOpen | boolean | No | If true, the popup opens immediately upon initialization. Defaults to false. | | onLoad | () => void | No | Callback fired when the widget iframe finishes loading. | | onClose | () => void | No | Callback fired when the user closes the popup or gets a close event. | | onMessage | (data: any) => void | No | Callback for receiving custom messages/events from the widget. | | onError | (error: any) => void | No | Callback fired if the widget encounters an initialization error. |

Workflow Configuration

You can pass an optional workflowConfiguration object to customize specific behaviors:

workflowConfiguration: {
  revalidateNin: true,      // Force NIN revalidation
  revalidateBvn: false,     // Skip BVN revalidation
  mbsValidityPeriod: 30,    // Days MBS data remains valid
  bvnAccountValidity: 30,   // Days BVN account data remains valid
  theme: "outside"          // Theme preference ('inside' or 'outside')
}

Setup & Development

1. Building

Build the SDK and Demo application for specific environments:

  • Local Build: npm run build
  • Sandbox Build: npm run build:sandbox
  • Production Build: npm run build:prod

The build output is isolated:

  • dist/sdk/: SDK library files.
  • dist/demo/: Standalone demo application.

2. Testing the Demo

To preview the demo application locally:

npm run start

This serves dist/demo at http://localhost:4173.

Local NPM Testing

Before publishing to the real NPM registry, you can test the package locally using these methods:

Method A: Using npm pack (Recommended)

  1. Build the SDK:
    npm run build:sdk
  2. Generate Tarball:
    npm pack
    This creates a file like decide-sdk-0.0.0.tgz in your root folder.
  3. Install in another project:
    npm install /path/to/decide-sdk-0.0.0.tgz

Method B: Using npm link

  1. Link the SDK:
    npm link
  2. Use in another project:
    cd /path/to/your-app
    npm link @indicina1/decide-sdk

License

MIT