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 🙏

© 2025 – Pkg Stats / Ryan Hefner

zerosurf-age-verify-button

v1.0.0

Published

Zero-knowledge age verification button for websites using ZeroSurf mobile app and Aadhaar

Downloads

6

Readme

ZeroSurf Age Verification Button

A React component for zero-knowledge age verification using the ZeroSurf mobile app and Aadhaar authentication.

Features

  • Zero-Knowledge Proof: Age verification without revealing personal data
  • Mobile Integration: Seamless deeplink integration with ZeroSurf app
  • Easy Integration: Drop-in React component
  • Customizable: Multiple themes and styling options
  • Analytics Ready: Built-in event tracking support
  • TypeScript: Full type definitions included

Installation

npm install zerosurf-age-verify-button

Quick Start

import { ZeroSurfButton } from 'zerosurf-age-verify-button';

function App() {
  return (
    <ZeroSurfButton
      onSuccess={(result) => {
        console.log('User verified!', result);
        // redirect to age-restricted content
      }}
      onError={(error) => {
        console.error('Verification failed:', error);
      }}
      buttonText="Verify Age with ZeroSurf"
      theme="dark"
    />
  );
}

How It Works

  1. User clicks the verification button
  2. Browser opens ZeroSurf mobile app via deeplink
  3. User scans their Aadhaar QR code in the app
  4. App generates zero-knowledge proof of age (18+)
  5. User returns to website with verification result
  6. Website receives proof without any personal data

Props

Required Props

None - component works with sensible defaults.

Optional Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | onSuccess | (result: VerificationResult) => void | - | Called when verification succeeds | | onError | (error: Error) => void | - | Called when verification fails | | onCancel | () => void | - | Called when user cancels | | buttonText | string | "🙋‍♂️ I swear I am 18+ years old" | Button text | | loadingText | string | "Opening ZeroSurf..." | Loading text | | theme | 'light' \| 'dark' \| 'custom' | 'light' | Button theme | | className | string | '' | CSS class name | | style | React.CSSProperties | {} | Inline styles | | disabled | boolean | false | Disable button | | timeout | number | 3000 | App launch timeout (ms) | | customDeeplinkScheme | string | 'zerosurf' | Custom deeplink scheme | | customChallenge | string | auto-generated | Custom challenge string | | enableAnalytics | boolean | false | Enable event tracking |

Types

interface VerificationResult {
  verified: boolean;
  proof?: string;
  timestamp: number;
}

Styling

Themes

// Light theme (default)
<ZeroSurfButton theme="light" />

// Dark theme
<ZeroSurfButton theme="dark" />

// Custom styling
<ZeroSurfButton 
  theme="custom"
  style={{
    background: 'linear-gradient(45deg, #purple, #pink)',
    color: 'white',
    borderRadius: '20px'
  }}
/>

CSS Classes

<ZeroSurfButton 
  className="my-custom-button"
  style={{ width: '100%' }}
/>

Advanced Usage

Custom Analytics

<ZeroSurfButton
  enableAnalytics={true}
  onSuccess={(result) => {
    // your analytics
    gtag('event', 'age_verification_success');
  }}
/>

Custom Deeplink Scheme

<ZeroSurfButton
  customDeeplinkScheme="myapp"
  customChallenge="custom-verification-id"
/>

Error Handling

<ZeroSurfButton
  onError={(error) => {
    if (error.message.includes('install')) {
      // show app installation instructions
      showAppInstallModal();
    } else {
      // handle other errors
      showErrorMessage(error.message);
    }
  }}
/>

Utility Functions

import { 
  createDeeplinkUrl, 
  parseVerificationResult,
  isMobileDevice 
} from 'zerosurf-age-verify-button';

// create custom deeplink
const url = createDeeplinkUrl('https://mysite.com', 'my-challenge');

// check if on mobile
if (isMobileDevice()) {
  // show mobile-specific UI
}

// manually parse verification result
const result = parseVerificationResult();

Requirements

  • React 16.8+
  • ZeroSurf mobile app installed on user's device
  • Website must be served over HTTPS (required for deeplinks)

Browser Support

  • Chrome 70+
  • Firefox 65+
  • Safari 12+
  • Edge 79+

Security Notes

  • Zero personal data is transmitted to your website
  • Only age verification (18+) status and proof hash are shared
  • Proof is cryptographically verifiable but reveals no identity
  • No tracking or storage of user information

License

MIT

Support


Made with ❤️ by the bluntbrain