0.0.3 • Published 6 years ago

recaptcha-react v0.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

recaptcha-react Version Badge

dependency status dev dependency status License Downloads

npm badge

A React component for rendering a reCAPTCHA captcha ✅

Live Playground

To run the demo on your own computer:

  • Clone this repository
  • $ npm install
  • Set your reCAPTCHA keys in stories/storybook-config.js
  • $ npm run storybook
  • Visit http://localhost:6006/

Getting Started

Install dependencies

Ensure packages are installed with correct version numbers by running:

(
  export PKG=recaptcha-react;
  npm info "$PKG" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g; s/ *//g' | xargs npm install --save "$PKG"
)

Which produces and runs a command like:

npm install --save recaptcha-react react@>=#.## react-dom@>=#.## ...

Usage

recaptcha-react exports a single component — Recaptcha. Simply import it and render wherever you need a captcha. See the props table below for how to configure the captcha to your needs.

import Recaptcha from 'recaptcha-react';

export default function MyCaptcha() {
  return (
    <Recaptcha siteKey="xxx" onChange={token => alert(token)} />
  );
}

Props

nametypeisRequireddefault value
siteKeystringtrue
onChangefunctiontrue
autoExecuteWhenInvisiblefunctiontrue
badge'bottomleft' | 'bottomright' | 'inline''inline'
componentstring | function'div'
invisiblebooleanfalse
onErrorfunction
onExpiredfunction
size'compact' | 'normal''normal'
tabIndexnumber0
theme'dark' | 'light''light'
type'audio' | 'image''image'
0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago