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

@devotp/web-sdk

v1.0.1

Published

Drop-in OTP verification widget for the web. Wires the headless `@devotp/react-ui` components to the DevOTP backend -- just provide your `siteId`.

Readme

@devotp/web-sdk

Drop-in OTP verification widget for the web. Wires the headless @devotp/react-ui components to the DevOTP backend -- just provide your siteId.

Installation

npm install @devotp/web-sdk
# or
bun add @devotp/web-sdk

React Usage

import { DevOtpSdk } from "@devotp/web-sdk";
import type { OnSuccessData, OnErrorData } from "@devotp/web-sdk";

function App() {
  const handleSuccess = (data: OnSuccessData) => {
    console.log("Verified!", data.type, data.signature);
  };

  const handleError = (error: OnErrorData) => {
    console.error(error.stage, error.error);
  };

  return (
    <DevOtpSdk
      siteId="your-site-id"
      identifierType="both"
      onSuccess={handleSuccess}
      onError={handleError}
    />
  );
}

Script Tag / Standalone Usage

The standalone build exposes a window.DevOtp global API. No bundler required.

<div id="devotp-container"></div>
<script src="https://cdn.example.com/devotp-sdk.bundle.js"></script>
<script>
  DevOtp.init({
    siteId: "your-site-id",
    containerId: "#devotp-container",
    identifierType: "both",
    onSuccess: function (data) {
      console.log("Verified!", data.type, data.signature);
    },
    onError: function (error) {
      console.error(error.stage, error.error);
    },
  });
</script>

Legacy Functions

For backward compatibility with the previous SDK, window.Devotp is also available:

// Email-only verification
DevOtp.initEmailVerification("#container", {
  siteId: "your-site-id",
  onSuccess: (data) => { /* ... */ },
});

// Phone-only verification
DevOtp.initPhoneVerification("#container", {
  siteId: "your-site-id",
  onSuccess: (data) => { /* ... */ },
});

Props (DevOtpSdkProps)

| Prop | Type | Default | Description | |------|------|---------|-------------| | siteId | string | required | Your DevOTP site ID | | identifierType | "email" \| "phone" \| "both" | "both" | Which input(s) to show | | onSuccess | (data: OnSuccessData) => void | -- | Called after successful verification | | onError | (error: OnErrorData) => void | -- | Called on any error |

Callback Types

OnSuccessData

interface OnSuccessData {
  type: "email" | "phone";
  identifier: string;
  signature: string;
  timestamp: number;
  country?: string;
}

OnErrorData

interface OnErrorData {
  type: "email" | "phone";
  error: string;
  stage: "send_otp" | "verify_otp" | "validation";
  identifier?: string;
}

Standalone Init Config

| Property | Type | Default | Description | |----------|------|---------|-------------| | siteId | string | required | Your DevOTP site ID | | containerId | string \| Element | required | CSS selector or DOM element to mount into | | identifierType | "email" \| "phone" \| "both" | "both" | Which input(s) to show | | onSuccess | (data: OnSuccessData) => void | -- | Success callback | | onError | (error: OnErrorData) => void | -- | Error callback |

Advanced

This package also re-exports all headless components and utilities for advanced use cases:

  • Components: DevOtp, DevOtpProvider, IdentifierStep, OtpModal, OtpInputBoxes, CountrySelector
  • Hooks: useDevOtp, useDevOtpContext
  • Utilities: createDevOtpHandlers, fetchThemeConfig, mapThemeToStyles, detectCountry, countryData