@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 +13 -0
- package/dist/{chunk-VPPTUL5K.mjs → chunk-BBRVE4RC.mjs} +85 -85
- package/dist/{chunk-32TEUD5K.mjs → chunk-IGSPJVI6.mjs} +26 -0
- package/dist/{detect-and-gate-Dnfo2t3B.d.ts → detect-and-gate-BfL39HDb.d.ts} +1 -1
- package/dist/{detect-and-gate-BNq26N9d.d.mts → detect-and-gate-DWOUDUSY.d.mts} +1 -1
- package/dist/index.d.mts +66 -7
- package/dist/index.d.ts +66 -7
- package/dist/index.js +311 -149
- package/dist/index.mjs +188 -53
- package/dist/{sdk-CJ6pmQGy.d.mts → sdk-DveMEqxl.d.mts} +2 -2
- package/dist/{sdk-CJ6pmQGy.d.ts → sdk-DveMEqxl.d.ts} +2 -2
- package/dist/testing.d.mts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +26 -0
- package/dist/testing.mjs +1 -1
- package/dist/vercel.d.mts +2 -2
- package/dist/vercel.d.ts +2 -2
- package/dist/vercel.js +124 -98
- package/dist/vercel.mjs +2 -2
- package/package.json +1 -1
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)`.
|