@webdecoy/node 0.29.0 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -318,6 +318,10 @@ Mount the endpoints with your adapter (`webdecoyCaptcha` in Express, `webdecoyCa
318
318
 
319
319
  When the browser provides usable scroll samples, `/verify` and `/score` return an `observations` entry with the ID `large-scroll-step-v1`. It summarizes the sample count and largest step in CSS pixels for diagnostics.
320
320
 
321
+ The default `weighted-mean-v1` policy preserves the original SDK behavior. Pass `onScoringComparison` to the server adapter, `Captcha`, or `DetectionEngine` to receive that baseline and the `noisy-or-floors-v1` score and recommendation on the server. Both scores use your configured category weights. The noisy-OR policy applies a decisive score floor to explicit WebDriver declarations and known driver injection signals in enabled categories. It also applies a corroboration floor when measured interaction and known driver findings agree.
322
+
323
+ After validating the comparison in your traffic, pass `scoringPolicy: 'noisy-or-floors-v1'` to enforce it for verification and token issuance. The option is available on `DetectionEngine`, `Captcha`, and every CAPTCHA server adapter; unknown policy names throw instead of silently falling back.
324
+
321
325
  ```ts
322
326
  import express from 'express';
323
327
  import { webdecoyCaptcha } from '@webdecoy/express';
@@ -336,6 +340,15 @@ app.post('/login', async (req, res) => {
336
340
  });
337
341
  ```
338
342
 
343
+ To enforce the noisy-OR policy, replace the adapter registration above with:
344
+
345
+ ```ts
346
+ app.use(webdecoyCaptcha({
347
+ secret: process.env.WEBDECOY_SECRET,
348
+ scoringPolicy: 'noisy-or-floors-v1',
349
+ }));
350
+ ```
351
+
339
352
  `WEBDECOY_SECRET` is just the variable name used here; pass the value as `secret`. Generate one with `openssl rand -hex 32`. Challenge and token stores are in memory by default; for serverless or multi-instance deployments, pass shared `challengeStore` and `tokenStore` implementations.
340
353
 
341
354
  To score signals yourself, use `new DetectionEngine(options).score(signals, context)`.