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.
https://fingerprintjs.github.io/BotD/main/
MIT License
954 stars 77 forks source link

export `detectors` and standalone detect/collect functions #143

Closed Le0Developer closed 7 months ago

Le0Developer commented 10 months ago

We're trying to implement botd by using collect() client-side, sending the components to the server and then running detect() there. The current BotDetector class interface does not allow that kind of use.

My suggestion: move detect and collect into standalone functions that are exported. The BotDetector class could use those functions itself too, to prevent code duplication. (this would also allow tree-shaking to remove the BotDetector class or detectors - assuming they are marked as pure)

The client-side is possible to implement manually (by copying the function out of the class and adapting it), because luckily the sources list is exported. The server-side validation is impossible because detectors is not currently being exported.

xnerhu commented 7 months ago

Released in v1.7.0