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

react-geetest-v4

v1.2.0

Published

React library for GeeTest captcha v4 integration

Readme

react-geetest-v4 is a library for React integration for GeeTest Captcha v4.


📦 Installation

npm install react-geetest-v4

pnpm

pnpm install react-geetest-v4

yarn

yarn add react-geetest-v4

📖 Usage

Component Usage

The simplest way to get started. Use the GeeTest component directly in your JSX.

import React from 'react';
import GeeTest, { GeeTestRef } from 'react-geetest-v4';

export default function App() {
  const captchaRef = React.useRef<GeeTestRef | null>(null);

  return (
    <div>
      {/* Invisible bind mode */}
      <GeeTest
        ref={captchaRef}
        captchaId='YOUR_CAPTCHA_ID'
        product='bind'
        onSuccess={(result) => console.log('Success:', result)}
      >
        <button onClick={() => captchaRef.current?.showCaptcha()}>
          Submit Form
        </button>
      </GeeTest>

      {/* Popup mode */}
      <GeeTest
        captchaId='YOUR_CAPTCHA_ID'
        product='popup'
        onSuccess={(result) => console.log('Verified:', result)}
      />
    </div>
  );
}

Hook Usage

For more advanced use cases, use the useGeeTest hook to manage the captcha state manually.

import { useGeeTest } from 'react-geetest-v4';

export default function App() {
  const { captcha, state } = useGeeTest('YOUR_CAPTCHA_ID', {
    product: 'bind',
  });

  const handleAction = () => {
    if (state === 'ready') {
      captcha?.showCaptcha();
    }
  };

  return <button onClick={handleAction}>Verify</button>;
}

Server-side Validation

Validate the captcha result on your server using the provided utilities.

import { generateSignToken, validateCaptcha } from 'react-geetest-v4';

// In your API handler
async function handler(req, res) {
  const { captcha_output, gen_time, lot_number, pass_token } = req.body;

  const { result } = await validateCaptcha({
    captcha_id: process.env.GEETEST_ID,
    lot_number,
    captcha_output,
    pass_token,
    gen_time,
    sign_token: generateSignToken(lot_number, process.env.GEETEST_KEY),
  });

  if (result === 'success') {
    // Captcha passed
  }
}

🚀 Demo

Check out the demo directory for a complete full-stack example using Hono and Vite.

cd demo
pnpm install
pnpm dev

📚 Documentation

For detailed configuration options, visit the API Documentation.

🤝 Contributing

Want to contribute? Awesome! To show your support is to star the project, or to raise issues on GitHub.

Thanks again for your support, it is much appreciated! 🙏

License

MIT © Shahrad Elahi and contributors.