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

@surtai/idv

v0.1.0

Published

Official SDK for Surt IDV, KYC identity verification

Readme

@surtai/idv

Official web SDK for Surt IDV: KYC identity verification.

The SDK opens the verify app in an overlay iframe. On mobile devices it goes straight to the camera flow (/intro); on desktop it shows a QR code so the user can hand off to their phone (/qrcode). It listens for postMessage events from the verify app and dispatches them to typed callbacks.

Install

npm install @surtai/idv
# or
pnpm add @surtai/idv
# or
yarn add @surtai/idv

No peer dependencies. Works in any browser bundle (React, Vue, Svelte, vanilla JS).

Quickstart

Callback API

import { SurtIDV } from '@surtai/idv';

const session = SurtIDV.init({
  token: 'PORTAL_JWT',
  onApproved: () => console.log('verified'),
  onRejected: () => console.log('rejected'),
  onCanceled: () => console.log('user closed'),
  onError: (e) => console.error(e.message),
});

// close programmatically
session.destroy();

Promise API

const result = await SurtIDV.verify({ token });

switch (result.status) {
  case 'approved':       /* user passed verification */ break;
  case 'rejected':       /* user failed verification */ break;
  case 'manual_review':  /* queued for human review */ break;
  case 'support':        /* user requested support */ break;
  case 'canceled':       /* user closed the modal */ break;
  case 'expired':        /* session expired */ break;
  case 'error':          /* console.error(result.error) */ break;
}

Options

| Option | Type | Default | Notes | |---|---|---|---| | token | string | required | Portal JWT issued by core-dd. | | baseUrl | string | https://identity.surt.com | Override the verify app origin. | | mode | 'mobile' \| 'desktop' | auto-detect | Force the mobile (/intro) or desktop (/qrcode) flow regardless of the device. | | container | HTMLElement | document.body | Mount target for the overlay. | | lang | string | from token | Locale override. Supported: en, es, pt. |

Callbacks

All callbacks are optional. Each maps directly to a postMessage event from the verify app.

| Callback | Fires when | |---|---| | onReady() | The verify app loaded inside the iframe. | | onApproved() | Verification passed ({ action: 'close', reason: 'approved' }). | | onRejected() | Verification failed. | | onManualReview() | Result deferred to human review. | | onSupport() | User requested support / session abandoned. | | onCanceled() | User tapped the close (X) button. | | onExpired() | Session expired. | | onError(e) | Network error, malformed token, unknown reason. e.message has details. |

How device detection works

The SDK picks mobile (direct camera flow) vs desktop (QR handoff) using the same heuristic as @surtai/faceguard:

  1. No touch input → desktop.
  2. Touch + viewport ≤ 1024px → mobile.
  3. Touch + UA looks like an iPad (Macintosh UA, maxTouchPoints > 2) → mobile.
  4. Touch + Android tablet (Android UA without Mobile) → mobile.
  5. Everything else (touch laptops, Surface) → desktop.

Override with mode: 'mobile' | 'desktop' if you need to force one.

Overlay styling

| Mode | Layout | |---|---| | Mobile | Fullscreen overlay, solid #0D141A background. | | Desktop | Centered modal, 420×760, rgba(0,0,0,0.6) backdrop, 24px rounded corners. |

The iframe is created with allow="camera; microphone; geolocation", no sandbox attribute (cross-origin embedding is supported by the verify app's CSP).

Environments

| Env | Default origin | |---|---| | Production | https://identity.surt.com |

For QA/staging, pass baseUrl explicitly. For local development against pnpm dev:web from the surt-verify monorepo, use baseUrl: 'http://localhost:3000'.

Browser support

Modern Chromium, Firefox, and Safari. Camera in iframes only works on https:// or http://localhost. iOS Safari requires the iframe allow="camera" attribute (set by the SDK).

Related

  • @surtai/idv-rn: same API for React Native (uses react-native-webview).
  • The verify app itself is at identity.surt.com.