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

bringid-sdk

v0.0.19-rc.22

Published

This guide explains how to integrate **bringid-sdk** into a **Next.js App Router** application, including verifying humanity and requesting score.

Readme

BringID Modal SDK 0.0.19 – Next.js Integration Guide

This guide explains how to integrate bringid-sdk into a Next.js App Router application, including verifying humanity and requesting score.


Installation

Install the SDK using Yarn:

yarn add bringid-sdk

Requirements

  • Next.js 13+ (App Router)
  • React 18+
  • Client-side wallet integration (e.g. Wagmi, Ethers)
  • App Router enabled (app/ directory)

Overview

The BringID SDK works by:

  1. SDK initialization
  2. Exposing SDK methods (verifyHumanity, requestScore)
  3. Rendering a global BringID modal (ONLY for verifyHumanity method to interact with BringIDModal)
  4. Allowing interaction from client components

SDK initialization

Create an sdk instance

import { BringID } from "bringid-sdk";
const sdk = new BringID();

SDK methods

When the sdk is ready you can use methods to request address score (requestScore) and to verify humanity (verifyHumanity)

sdk.requestScore method

const { score } = await sdk.requestScore("0x..."); // address is a required param
console.log(score); // `score` is a number between 0 and 100

sdk.verifyHumanity method

To use it correctly, you must:

  • Create a Modal Provider
  • Wrap it in your Root Layout
  • Call sdk.verifyHumanity from Client Components only

1. Create Modal Provider

Create a client-side provider that renders the verification dialog once.

@/app/providers/ModalProvider.tsx

"use client";

import { BringIDModal } from "bringid-sdk";
import React from "react";

type Props = {
  children: React.ReactNode;
};

export default function ModalProvider({ children }: Props) {
  // Replace with actual wallet data (wagmi, ethers, etc.)
  const address: string | undefined = undefined;
  const signer: any = null;

  return (
    <>
      {signer ? (
        <BringIDModal
          address={address}
          iframeOnLoad={() => {
            console.log("modal window is ready to use. iframe is fully loaded");
          }}
          generateSignature={async (value: string) =>
            await signer.signMessage(value)
          }
        />
      ) : null}
      {children}
    </>
  );
}
Notes
  • Render BringIDModal only once in the app
  • address and signer in the generateSignature callback should come from your wallet provider (wagmi, etc.)
  • IMPORTANT: use mode="dev" property to enable dev mode. Otherwise production mode is enabled by default

2. Wrap Root Layout

Wrap your app with the modal provider in RootLayout.

@/app/layout.tsx

import ModalProvider from "@/app/providers/ModalProvider";

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <head>
        <meta
          name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"
        />
      </head>
      <body>
        <WagmiProvider>
          <ModalProvider>{children}</ModalProvider>
        </WagmiProvider>
      </body>
    </html>
  );
}

3. Call verifyHumanity SDK Method

When the modal window is fully rendered you can use sdk.verifyHumanity method

const { proofs, points } = await sdk.verifyHumanity();
console.log(
  proofs, // array of semaphore proofs
  points, // amount of points
);

Also you can use scope option. It can be presented as a string if specific scope needed. By default the scope will be computed from registry address

const { proofs, points } = await sdk.verifyHumanity({
  scope: "0x....",
});

console.log(
  proofs, // array of semaphore proofs
  points, // amount of points
);

That method should be called from Client Components.


Example: Verify humanity

@/app/utils/sdk.tsx

import { BringID } from "bringid-sdk";

const initSDK = (() => {
  let sdk: null | BringID = null;

  return () => {
    if (!sdk) {
      const newSDK = new BringID();
      sdk = newSDK;

      return sdk;
    }

    return sdk;
  };
})();

export default initSDK;

@/app/components/main.tsx

"use client";

import { FC, useState } from "react";
import initSDK from "@/app/utils/sdk.tsx";

type Props = {
  setStage?: (stage: string) => void;
};

const Main: FC<Props> = ({ setStage }) => {
  const [points, setPoints] = useState<number>(0);

  return (
    <div>
      <h1>Humanity points: {points}</h1>
      <button
        onClick={async () => {
          try {
            const sdk = initSDK();
            const { points } = await sdk.verifyHumanity();

            setPoints(points);
          } catch (err) {
            console.error(err);
          }
        }}
      >
        Verify humanity
      </button>
    </div>
  );
};

export default Main;

Best Practices

  • Ensure wallet is connected before requesting proofs
  • Avoid rendering the modal multiple times
  • For large proof objects, consider collapsing or lazy rendering

Troubleshooting

Modal does not open

  • Ensure ModalProvider is rendered in layout.tsx
  • Ensure 'use client' is present

License

Refer to the BringID SDK license and documentation for details.