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

@dynamic-labs-sdk/react-native-captcha

v1.38.0

Published

Captcha challenge widgets for React Native apps using Dynamic.

Readme

@dynamic-labs-sdk/react-native-captcha

Captcha challenge widgets for React Native apps using Dynamic.

Provides self-contained HCaptchaChallenge and TurnstileChallenge components that render their provider's widget in a react-native-webview and return the captcha token over a postMessage bridge. Pass the token to @dynamic-labs-sdk/client's setCaptchaToken before sign-in methods that require captcha.

Installation

pnpm add @dynamic-labs-sdk/react-native-captcha

Requires @dynamic-labs-sdk/client and react-native-webview.

Usage

Read the active provider and site key from getCaptchaSettings, then render the matching challenge component.

import { useState } from 'react';
import { View, Button } from 'react-native';
import { CaptchaProviderEnum, getCaptchaSettings, setCaptchaToken } from '@dynamic-labs-sdk/client';
import { HCaptchaChallenge, TurnstileChallenge } from '@dynamic-labs-sdk/react-native-captcha';

function SignInScreen() {
  const [captchaReady, setCaptchaReady] = useState(false);
  const settings = getCaptchaSettings();
  const siteKey = settings?.siteKey;

  const handleSignIn = async () => {
    // sendEmailOTP, auth.wallet.connect, etc.
  };

  if (!settings || !siteKey) {
    return <Button title="Sign in" onPress={handleSignIn} />;
  }

  const handleToken = (token: string) => {
    setCaptchaToken({ captchaToken: token });
    setCaptchaReady(true);
  };

  const Challenge =
    settings.provider === CaptchaProviderEnum.Hcaptcha
      ? HCaptchaChallenge
      : TurnstileChallenge;

  return (
    <View>
      <Challenge
        baseUrl="https://your-whitelisted-origin.com"
        siteKey={siteKey}
        onToken={handleToken}
        onError={(error) => console.error(error.message)}
      />
      <Button title="Sign in" disabled={!captchaReady} onPress={handleSignIn} />
    </View>
  );
}

The baseUrl prop is the origin the widget document is served under. hCaptcha and Turnstile site keys only render on whitelisted hostnames, so set it to a domain you have added to your provider's site configuration.

Components

| Component | Provider | | --------- | -------- | | HCaptchaChallenge | hCaptcha | | TurnstileChallenge | Cloudflare Turnstile |

Both components accept baseUrl, siteKey, onToken, onError, and an optional style prop. onToken fires once when the user solves the challenge; onError fires once on challenge error, token expiry, or WebView load failure. The returned errors are typed (HCaptchaError / TurnstileError) so you can branch on error instanceof HCaptchaError or inspect error.message.

Use the style prop to override the default height, border radius, or other container styles to match your app's design.

Retrying a challenge

onToken and onError each fire at most once per mounted widget. If you need to let the user retry after a challenge error or token expiry, unmount and remount the component, for example by incrementing a React key:

const [attemptKey, setAttemptKey] = useState(0);

<Challenge
  key={attemptKey}
  baseUrl="https://your-whitelisted-origin.com"
  siteKey={siteKey}
  onToken={handleToken}
  onError={(error) => {
    console.error(error.message);
    setAttemptKey((k) => k + 1);
  }}
/>