@redsocs/spam-warden 1.0.6 → 1.0.8

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
@@ -26,40 +26,20 @@ You can test the spam engine interactively, analyze your forms, and generate aut
26
26
  > **Are you a Thai government agency or public sector website administrator?**
27
27
  > Get your free token configuration and drop-in script to protect your online portals from annoying gambling/loan ads and spam campaigns at [redsocs.com/spam-warden](https://redsocs.com/spam-warden).
28
28
 
29
- ### 1. The "No-Code" Way (Auto-Blocking)
29
+ ### 1. Drop-in Protection (Heuristic Auto-Blocking)
30
30
 
31
- Add this script to your page. It will automatically find your form and block submission if spam is detected.
31
+ Add this script to your page. It will automatically find your most significant forms (using an intelligent heuristic: top 2 forms with >= 2 inputs) and block submission if spam is detected.
32
32
 
33
33
  ```html
34
- <script src="https://cdn.redsocs.com/js/spamwarden.min.js?client=cG9zdHEtZm9ybXxtZXNzYWdlLWlucHV0fDE"></script>
34
+ <script src="https://cdn.redsocs.com/js/spamwarden.min.js?client=MHxzaWVtLnJlZHNvY3MuY29tL3Yx"></script>
35
35
  ```
36
36
 
37
- _Note: The `client` parameter is a Base64 configuration string of `formId|inputId|sdFlag|siemEndpoint` (e.g., `postq-form|message-input|1` encoded)._
37
+ _Note: The `client` parameter is a Base64 configuration string of `sdFlag|siemEndpoint` (e.g., `0|siem.redsocs.com/v1` encoded)._
38
38
 
39
- ### 2. Manual Configuration
40
-
41
- ```html
42
- <script src="dist/spamwarden.min.js"></script>
43
- <script>
44
- spamwarden.configure({
45
- siteToken: "YOUR_TOKEN",
46
- formId: "contact-form",
47
- inputId: "message-field",
48
- autoReport: true,
49
- isTrusted: true, // Required to authorize telemetry reporting
50
- reportSD: true, // Optional: Enable PII/DLP leak telemetry auditing
51
- siemEndpoint: "https://api.yourdomain.com/v1/telemetry", // Optional: Custom secondary SIEM/SOC endpoint
52
- onSpam: (result) => {
53
- alert("Please do not send spam!");
54
- },
55
- });
56
- </script>
57
- ```
58
-
59
- ### 3. API Usage (Node or Browser)
39
+ ### 2. API Usage (Node or Browser)
60
40
 
61
41
  ```javascript
62
- const result = spamwarden.spamcheck("สมัครสมาชิกวันนี้ รับโบนัส ฟรี!");
42
+ const result = spamwarden.spamcheck("[Hello, this is a Thai casino & scam ads — and guess what? Your tax pays for my traffic.]");
63
43
  if (result.isSpam) {
64
44
  console.log("Blocked:", result.reason || "AI match");
65
45
  console.log("Confidence:", result.prob);
@@ -112,7 +92,7 @@ You can spin up a local simulation server to test the DOM auto-blocking behavior
112
92
  ```text
113
93
  🚨 [SIEM RECEIVER] Blocked Payload Received!
114
94
  ================================================
115
- Client Token: cG9zdHEtZm9ybXxtZXNzYWdlLWlucHV0fDF8aHR0cDovL2xvY2FsaG9zdDozMDAwL3YxL3RlbGVtZXRyeQ
95
+ Client Token: MXxodHRwOi8vbG9jYWxob3N0OjMwMDAvdjEvdGVsZW1ldHJ5
116
96
  URL: h_tt_p://localhost:3000/
117
97
  Rule Matched: currency_symbol
118
98
  Confidence: 100%
@@ -125,7 +105,7 @@ You can spin up a local simulation server to test the DOM auto-blocking behavior
125
105
 
126
106
  # About
127
107
 
128
- - **Version:** 1.0.6 (v2 Engine)
108
+ - **Version:** 1.0.8 (v2 Engine)
129
109
  - **Author:** [RedSocs](https://github.com/RedSocs)
130
110
  - **License:** MIT
131
111
  - **Model Origin:** Trained via [RedSocs/spam-labeler](https://github.com/RedSocs/spam-labeler)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redsocs/spam-warden",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Lightweight client-side JavaScript library for real-time spam detection. Trained on Thai spam data using Bernoulli Naive Bayes.",
5
5
  "main": "dist/spamwarden.min.js",
6
6
  "browser": "dist/spamwarden.min.js",