JSPM

@leminnow/react-lemin-cropped-captcha

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 75
  • Score
    100M100P100Q92066F

Lemin Captcha is uniquely playful, robust, and effective. Through gamification, we are curing the pains of traditional CAPTCHA.

Package Exports

  • @leminnow/react-lemin-cropped-captcha

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@leminnow/react-lemin-cropped-captcha) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme



React Lemin Cropped Captcha

Lemin Captcha is uniquely playful, robust, and effective. Through gamification, we are curing the pains of traditional CAPTCHA.

Installation:

npm install @leminnow/react-lemin-cropped-captcha

Using:


Use LeminCroppedCaptchaContainer in your component

import {LeminCroppedCaptchaContainer} from "@leminnow/react-lemin-cropped-captcha";

function App() {
    return (
        <div>
            <form>
                <LeminCroppedCaptchaContainer
                    containerId={"..."}
                    captchaId={"CROPPED_..."}/>
            </form>
        </div>
    );
}

Use captcha methods with Multiple Instances

import {leminCroppedCaptcha, LeminCroppedCaptchaContainer} from "@leminnow/react-lemin-cropped-captcha";

function getCaptchaValue() {
    const values = leminCroppedCaptcha.getCaptcha('CROPPED_...').getCaptchaValue()
}

function App() {
    return (
        <div>
            <form>
                <LeminCroppedCaptchaContainer
                    containerId={"..."}
                    captchaId={"CROPPED_..."}/>
            </form>
            <button onClick={getCaptchaValue}>Get captcha value</button>
        </div>
    );
}

Use captcha methods with LeminCroppedCaptcha Object

import {LeminCroppedCaptcha, LeminCroppedCaptchaContainer} from "@leminnow/react-lemin-cropped-captcha";


const myCaptcha = new LeminCroppedCaptcha('...', 'CROPPED_...')

function getCaptchaValues() {
    const values = myCaptcha.getCaptchaValue();
}

function App() {
    return (
        <div>
            <form>
                <LeminCroppedCaptchaContainer
                    containerId={myCaptcha.containerId}
                    captchaId={myCaptcha.captchaId}/>
            </form>
            <button onClick={getCaptchaValues}>Get captcha values</button>
        </div>
    );
}

API

leminCroppedCaptcha Methods

Name Return Type Parameter Description
getCaptcha CaptchaInstance (CAPTCHA_KEY: Optional String) => Returns the given CAPTCHA_KEY's captcha instance. If CAPTCHA_KEY is empty, it will return first captcha instance.
getInstances CaptchaInstance{} (CAPTCHA_KEY: Optional String) => Returns all the instances of captchas
destroyAll void () => Destroys all captchas on the page.
reloadAll void () => Reload all captchas on the page.

LeminCroppedCaptcha Object Methods

Name Return Type Parameter Description
getCaptchaValue {"answer": "answer","challenge_id": "challenge_id"} () => Returns the captcha value on the page for needed validation
isReady boolean () => Returns the state of captcha
reloadPuzzle void () => Reloads puzzle, you may use it in fail scenarios.
onLoad void (callbackFunction = function(){}) => Calls the function when the captcha loaded.
loadPuzzleError void (callbackFunction = function(){}) => Calls the function when the captcha loaded.
destroyCaptcha void () => Destroys the captcha on the page
adjustSize void () =>
display void () =>
getToken void () =>
loadPuzzleImage void () =>
setUserinfo void () =>
stopRefreshing void () =>