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 🙏

© 2024 – Pkg Stats / Ryan Hefner

the-last-spelling-bee-re-captcha

v3.0.9

Published

This package helps you to get TheLastSpellingBeeReCaptcha questions and answer

Downloads

164

Readme

the-last-spelling-bee-re-captcha

A simple and framework to generate and verify TheLastSpellingBee ReCaptcha. This package currently supports TheLastSpellingBeeReCaptcha V1.

Installation


npm install the-last-spelling-bee-re-captcha

yarn add the-last-spelling-bee-re-captcha

Usage


import { TheLastSpellingBeeReCaptcha } from 'the-last-spelling-bee-re-captcha';

Props

The TheLastSpellingBeeReCaptcha component accepts the following props:

  • questionType: string (optional): Specifies the type of question to be displayed. Available options are CHARACTERS, NUMBERS, RANDOM, or COMPLEX. If not provided, the default question type is CHARACTERS..

questionType Examples

  • CHARACTERS Questions: Question : D A D D Y Answer: 4 1 4 4 25

  • NUMBERS Questions: Question : 4 -1- 4 - 4 - 25 Answer: D A D D Y

  • RANDOM Questions: Question : This is going to be generate both Characters and number randomly

  • COMPLEX Questions: Question : D - 1 - D - 4 - Y Answer: 4 A 4 D 25

  • wordLength number (optional): Specifies the length of the character word that users need to answer. For example, if set to 3, users will be asked to provide a 3-character word. The default value is 3.

  • reCaptchaKey secret (required): A string representing the API key to use for the request.

  • refreshonVerifyReCaptcha (optional): Specifies whether to refresh the ReCaptcha widget after a successful verification. Default is false.

  • refreshReCaptcha (optional): Specifies whether to refresh the ReCaptcha widget on every render. Default is false.

  • onVerifyCaptcha (required): A callback function that will be called when the user completes the ReCaptcha challenge. It receives the verification result as a parameter.

Examples

<TheLastSpellingBeeReCaptcha
    reCaptchaKey={'your-TheLastSpellingBee-key'}
    onVerifyCaptcha={(result) => {
        // Handle the captcha verification result
        console.log('Result: ', result);
    }}
/>

Example Response

An example response from the TheLastSpellingBeeReCaptcha after a successful verification:

{
  "status": 200,
  "result": true
}

Notes

  • Make sure to replace 'your-TheLastSpellingBee-key' with your actual TheLastSpellingBee ReCaptcha API key.
  • The onVerifyCaptcha callback function should handle the verification result according to your application's requirements.
  • The package provides a default question type of CHARACTERS and a default word length of 3 if not explicitly specified.
  • Please refer to the documentation of TheLastSpellingBee ReCaptcha for more information (https://thelastspellingbee.com/api-reference)

Error Handling

The TheLastSpellingBeeReCaptcha component may encounter errors during initialization or verification. You can handle these errors by wrapping the component in a try-catch block or utilizing the onError prop.

try {
    <TheLastSpellingBeeReCaptcha
        reCaptchaKey={'your-TheLastSpellingBee-key'}
        onVerifyCaptcha={(result) => {
            // Handle the captcha verification result
            console.log('Result: ', result);
        }}
        onError={(error) => {
            // Handle the error
            console.error('Error: ', error);
        }}
    />;
} catch (error) {
    // Handle the result error
    console.error('Error: ', error);
}

The onError prop allows you to specify a callback function that will be called when an error occurs. It receives the error object as a parameter.

Dependencies

The the-last-spelling-bee-re-captcha package has one dependency: axios. This package is used to make HTTP requests to the ReCaptcha API.

Contribution

If you would like to contribute to the the-last-spelling-bee-re-captcha package, you can do so by submitting a pull request on GitHub. The package repository can be found at https://github.com/suleigolden/thelastspellingbee-npm-package

Credits

The the-last-spelling-bee-re-captcha package was created by TheLastCodeBender and is maintained by TheLastSpellingBeeGTest.

The package was inspired by the ReCaptcha API provided by Google, which is used by millions of websites to protect against spam and abuse.

We would like to thank the developers of the following open source packages, which were used in the creation of this package:

  • axios: A promise-based HTTP client for the browser and Node.js.
  • fetch: A browser API for making HTTP requests.
  • Jest: A JavaScript testing framework used for unit testing.

We also want to thank the many contributors who have helped improve the package through bug reports, feature requests, and code contributions. Your contributions are greatly appreciated!

If you have any questions or feedback about the package, please don't hesitate to contact us. We would be happy to hear from you.

License

Copyright (c) 2023 TheLastSpellingBee

MIT (http://www.opensource.org/licenses/mit-license.php)