An open source Javascript HoneyPot library, release under MIT license. This is currently in active development
Links : Github - NPM - Document - Live Demo
Version 1.1.x is here!
- Remake API to be more simple and effective
- Sandbox dependencies for more security
- Add a ForceCaptcha option to make your forms automatically acquire Google reCaptcha on creation
- Well tested 256 specs with mocha, blanket and istanbul
Supports : Google reCaptcha - jQuery
Thank to jsDelivr's awsomeness, honeyjs can be deliveried from the cloud to your site in miliseconds ( only 1.97KB gzipped ), use this :
<script src="//cdn.jsdelivr.net/honeyjs/1.1.0/honey.min.js"></script>
Or bundle with jQuery for convenient DOM selector string and plugin stuff
<script src="//cdn.jsdelivr.net/g/[email protected],[email protected]"></script>
Install :
npm install honeyjs
// or using bower
bower install honeyjs
Need help? Please leave your issues HERE
This library makes honey pot implementation so easy with some lines of javascript code.
The simple javascript way
var form = document.getElementById('#1');
honey(form);
Or jQuery style
$('#1').honey();
// or
honey('#1');
Check honey and jQuery plugin on or document for more information.
Automatically secure all your forms
honey.all();
Global configurations
honey.config({
theme : 'dark', // reCaptcha theme
size : 'normal' // reCaptcha size
});
// retrive global options
var captchaTheme = honey.config('theme');
View our document for more information
For individually config honeypot(s), you will need to get an instance of Pot or Pots to configure over these objects
var pots = honey(forms);
// set acceptable minimum amount of time for form completion
pots.config({ time : 10 });
// set a name of empty-required input field
pots.name('empty');
Since 1.0.4, honeyjs started supporting reCaptcha. You need to load Google reCaptcha api script before honeyjs, like this :
<script src="//www.google.com/recaptcha/api.js?render=explicit"></script>
<script src="honey.js"></script>
How to use
honey(forms).captcha('your-site-key');
// with jQuery
$(forms).honey('your-site-key');
Check out captcha for more information
Set an optional global reCaptcha sitekey for reusing
honey.requireRecaptcha('your-site-key');
// init recaptcha on a form, you don't need to provide a sitekey again
honey(form).captcha();
Force all forms to use reCaptcha
honey.forceRecaptcha('your-site-key');
// reCaptcha will be acquired automatically without calling .captcha()
honey(form);
Please view HISTORY.md file
See contributors
Everyone is welcome :)
Here is some steps :
- Make sure you have a Github account and have installed npm
- Fork this repo, then clone with
[email protected]:your-user-name/honeyjs.git
- Run
npm install
to install all dependencies - Run
npm test
to be sure everything is working - Make your changes ( optional write an additional test file if you'are adding somethings and the old test files cannot cover )
- Run
npm test
again to make sure everything is working, then checkcoverage/lcov-report/index.html
to make sure coverage is above 95% ( This is a security library so we need everything to perform as intended ) - Push to your fork, create a pull request and write a good commit message.
This project is actively maintained. Please feel free to contact me if you need any further assistance.
Enjoy 🍻