1.0.0 • Published 7 months ago
@internetarchive/recaptcha-manager v1.0.0
Internet Archive reCaptcha Manager
A library to lazy load and interact with reCaptcha
Installation
> npm install @internetarchive/recaptcha-manager
Usage
const recaptchaManager = new RecaptchaManager({
defaultSiteKey: 'your-site-key',
});
// will load recaptcha library if it's not loaded
const recaptchaWidget = await recaptchaManager.getRecaptchaWidget({
recaptchaParams: {
tabindex: 0,
theme: 'light',
type: 'image',
},
});
const token = await recaptchaWidget.execute();
// submit token with your post and validate on the backend
For more usage examples, see demo/app-root.ts
and test/recaptcha-manager.test.ts
.
Local Demo with web-dev-server
npm run start
To run a local development server that serves the basic demo located in demo/index.html
Testing with Web Test Runner
To run the suite of Web Test Runner tests, run
npm run test
To run the tests in watch mode (for <abbr title="test driven development">TDD</abbr>, for example), run
npm run test:watch
Linting with ESLint, Prettier, and Types
To scan the project for linting errors, run
npm run lint
To automatically fix many linting errors, run
npm run format
1.0.0
7 months ago
0.1.2-webdev-7354.0
7 months ago
0.1.2-alpha.1
3 years ago
0.1.0
4 years ago
0.1.1
4 years ago
0.0.1-alpha.4
4 years ago
0.0.1-alpha.3
4 years ago
0.0.1-alpha.2
4 years ago
0.0.1-alpha.1
4 years ago