fingerprintjs / BotD

Bot detection library that runs in the browser. Detects automation tools and frameworks. No server required, runs 100% on the client. MIT license, no usage restrictions.

Home Page:https://fingerprintjs.github.io/BotD/main/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is this library available for Cloudflare Workers?

CatAnonymous opened this issue · comments

Is there any way to run it on cf workers environment let me know. Thankyou!

You can't run the BotD code on a CloudFlare worker directly because it needs browser APIs to work. But you can make a worker inject the BotD JS script into the HTML code. There is no ready solution for CloudFlare workers, you need to make it yourself. An example strategy:

  1. Make the worker stand between the client side and your website. The worker must handle requests to and responses from your website.
  2. If a response is an HTML page, add <script> tags to it. The tags should download and execute BotD, and inject the result into HTML forms that you want to protect as <input type="hidden" ... > tags.
  3. When the worker handles a request to a protected form, it should check the input value, and block the request if necessary.

You can't run the BotD code on a CloudFlare worker directly because it needs browser APIs to work. But you can make a worker inject the BotD JS script into the HTML code. There is no ready solution for CloudFlare workers, you need to make it yourself. An example strategy:

  1. Make the worker stand between the client side and your website. The worker must handle requests to and responses from your website.
  2. If a response is an HTML page, add <script> tags to it. The tags should download and execute BotD, and inject the result into HTML forms that you want to protect as <input type="hidden" ... > tags.
  3. When the worker handles a request to a protected form, it should check the input value, and block the request if necessary.

Thankyou, using it on the frontend can be easily bypassed, it's not the solution I want, I'll look for another library