An open source Javascript HoneyPot library

Usage no npm install needed!

<script type="module">
  import honeyjs from 'https://cdn.skypack.dev/honeyjs';



Build Status Code Climate Coverage Status

An open source Javascript HoneyPot library, release under MIT license.

Links : Github - NPM - Document - Live Demo

honeyjs image

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/jquery@1.11.3,honeyjs@1.1.0"></script>

Install :

npm install honeyjs

// or using bower
bower install honeyjs

Need help? Please leave your issues HERE

Table of contents

  1. How to use
  2. Configuration
  3. Google reCaptcha
  4. Changelog
  5. Contributors
  6. Contribution

How to use

This library makes honey pot implementation so easy with some lines of javascript code.

The simple javascript way

var form = document.getElementById('#1');


Or jQuery style


// or

Check honey and jQuery plugin on or document for more information.

Automatically secure all your forms



Global configurations

    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

Google reCaptcha

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


// with jQuery

Check out captcha for more information

Set an optional global reCaptcha sitekey for reusing


// init recaptcha on a form, you don't need to provide a sitekey again

Force all forms to use reCaptcha


// reCaptcha will be acquired automatically without calling .captcha()


Please view HISTORY.md file


See contributors


Everyone is welcome :)

Here is some steps :

  1. Make sure you have a Github account and have installed npm
  2. Fork this repo, then clone with git@github.com:your-user-name/honeyjs.git
  3. Run npm install to install all dependencies
  4. Run npm test to be sure everything is working
  5. Make your changes ( optional write an additional test file if you'are adding somethings and the old test files cannot cover )
  6. Run npm test again to make sure everything is working, then check coverage/lcov-report/index.html to make sure coverage is above 95% ( This is a security library so we need everything to perform as intended )
  7. 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 :beers: