1.1.4 • Published 2 years ago

@tokensuite/react-slider-captcha-v2-react v1.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

@tokensuite/react-slider-captcha-v2-react

Installation

React frontend:

npm i @tokensuite/react-slider-captcha-v2-react

Usage

React:

import SliderCaptcha from '@tokensuite/react-slider-captcha-v2-react';

function verifiedCallback(token) {
  console.log('Captcha token: ' + token);
}

function App() {
  return (
    <SliderCaptcha
      create="https://example.com/captcha/create"
      verify="https://example.com/captcha/verify"
      callback={verifiedCallback}
    />
  );
}

React component props

NameTypeDefaultDescription
callbackfunc(token) => console.log(token)Called with token on successful verification
createstring or funccaptcha/createEither the URL to fetch data from or a function () returning a promise which resolves with { background, slider } as PNG buffers
verifystring or funccaptcha/verifyEither the URL to fetch data from or a function (response, trail) returning a promise which resolves with { result, token }
text{ anchor: string, challenge: string }{ anchor: 'I am human', challenge: 'Slide to finish the puzzle' }Text used for captcha
variantstringlightUse 'light' for light theme, 'dark' for dark theme
hasReloadButtonbooleanfalseUse false for no reload button, true for a reload button on top right
hasOutsideClickbooleanfalseUse false for no outside click, true for a closing on outside click
hideButtonbooleanfalseIf false the click to solve captcha button will be hidden

Light:\ npm.io\ Dark:\ npm.io

Inspiration

Slider Captcha - A captcha library for web applications from adrsch (MIT License)

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago