guardian-risk-browser 0.1.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/LICENSE +21 -0
- package/README.md +36 -0
- package/dist/index.cjs +19 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +21 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Guardian Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# guardian-risk-browser
|
|
2
|
+
|
|
3
|
+
> **Requires:** [`guardian-risk`](https://www.npmjs.com/package/guardian-risk) (core)
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install guardian-risk guardian-risk-browser
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
> **Stub package** — API may change before `1.0.0`.
|
|
10
|
+
|
|
11
|
+
Browser integration for [guardian-risk](https://www.npmjs.com/package/guardian-risk). Collects client-side behavioral and fingerprint signals.
|
|
12
|
+
|
|
13
|
+
## Planned signals
|
|
14
|
+
|
|
15
|
+
| Signal | Source |
|
|
16
|
+
|--------|--------|
|
|
17
|
+
| `mouseLinearity` | Mouse movement patterns |
|
|
18
|
+
| `keystrokeInterval` | Typing rhythm |
|
|
19
|
+
| `headlessUA` | User agent heuristics |
|
|
20
|
+
| `canvasFingerprint` | Canvas hash |
|
|
21
|
+
|
|
22
|
+
## Usage (stub)
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { Guardian } from 'guardian-risk';
|
|
26
|
+
import { browserPlugin, collectSignals } from 'guardian-risk-browser';
|
|
27
|
+
|
|
28
|
+
const guardian = new Guardian().use(browserPlugin());
|
|
29
|
+
|
|
30
|
+
collectSignals(guardian);
|
|
31
|
+
const report = guardian.analyze();
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Status
|
|
35
|
+
|
|
36
|
+
Not yet published. Implementation in progress.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/index.ts
|
|
4
|
+
function browserPlugin(options = {}) {
|
|
5
|
+
const { container = "document" } = options;
|
|
6
|
+
return {
|
|
7
|
+
name: "guardian-risk-browser",
|
|
8
|
+
install(_guardian) {
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function collectSignals(guardian) {
|
|
13
|
+
return guardian.signal("signalSource", "browser").signal("browserPlugin", "stub");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
exports.browserPlugin = browserPlugin;
|
|
17
|
+
exports.collectSignals = collectSignals;
|
|
18
|
+
//# sourceMappingURL=index.cjs.map
|
|
19
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;AAcO,SAAS,aAAA,CAAc,OAAA,GAAgC,EAAC,EAAW;AACxE,EAAA,MAAM,EAAE,SAAA,GAAY,UAAA,EAAW,GAAI,OAAA;AAEnC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,uBAAA;AAAA,IACN,QAAQ,SAAA,EAAW;AACZ,IAEP;AAAA,GACF;AACF;AAKO,SAAS,eACd,QAAA,EACkC;AAClC,EAAA,OAAO,SACJ,MAAA,CAAO,cAAA,EAAgB,SAAS,CAAA,CAChC,MAAA,CAAO,iBAAiB,MAAM,CAAA;AACnC","file":"index.cjs","sourcesContent":["import type { Plugin } from 'guardian-risk';\n\n/** Options for the browser plugin (stub). */\nexport interface BrowserPluginOptions {\n /** DOM element to attach behavioral collectors. Defaults to document. */\n readonly container?: string;\n}\n\n/**\n * Browser plugin for guardian-risk.\n *\n * @stub Future versions will collect mouse, keyboard, and fingerprint signals\n * in the page and add them to Guardian before analysis.\n */\nexport function browserPlugin(options: BrowserPluginOptions = {}): Plugin {\n const { container = 'document' } = options;\n\n return {\n name: 'guardian-risk-browser',\n install(_guardian) {\n void container;\n // Stub: collectors will attach listeners and call guardian.signal()\n },\n };\n}\n\n/**\n * @stub Future helper to start client-side signal collection.\n */\nexport function collectSignals(\n guardian: import('guardian-risk').Guardian,\n): import('guardian-risk').Guardian {\n return guardian\n .signal('signalSource', 'browser')\n .signal('browserPlugin', 'stub');\n}\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as guardian_risk from 'guardian-risk';
|
|
2
|
+
import { Plugin } from 'guardian-risk';
|
|
3
|
+
|
|
4
|
+
/** Options for the browser plugin (stub). */
|
|
5
|
+
interface BrowserPluginOptions {
|
|
6
|
+
/** DOM element to attach behavioral collectors. Defaults to document. */
|
|
7
|
+
readonly container?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Browser plugin for guardian-risk.
|
|
11
|
+
*
|
|
12
|
+
* @stub Future versions will collect mouse, keyboard, and fingerprint signals
|
|
13
|
+
* in the page and add them to Guardian before analysis.
|
|
14
|
+
*/
|
|
15
|
+
declare function browserPlugin(options?: BrowserPluginOptions): Plugin;
|
|
16
|
+
/**
|
|
17
|
+
* @stub Future helper to start client-side signal collection.
|
|
18
|
+
*/
|
|
19
|
+
declare function collectSignals(guardian: guardian_risk.Guardian): guardian_risk.Guardian;
|
|
20
|
+
|
|
21
|
+
export { type BrowserPluginOptions, browserPlugin, collectSignals };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as guardian_risk from 'guardian-risk';
|
|
2
|
+
import { Plugin } from 'guardian-risk';
|
|
3
|
+
|
|
4
|
+
/** Options for the browser plugin (stub). */
|
|
5
|
+
interface BrowserPluginOptions {
|
|
6
|
+
/** DOM element to attach behavioral collectors. Defaults to document. */
|
|
7
|
+
readonly container?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Browser plugin for guardian-risk.
|
|
11
|
+
*
|
|
12
|
+
* @stub Future versions will collect mouse, keyboard, and fingerprint signals
|
|
13
|
+
* in the page and add them to Guardian before analysis.
|
|
14
|
+
*/
|
|
15
|
+
declare function browserPlugin(options?: BrowserPluginOptions): Plugin;
|
|
16
|
+
/**
|
|
17
|
+
* @stub Future helper to start client-side signal collection.
|
|
18
|
+
*/
|
|
19
|
+
declare function collectSignals(guardian: guardian_risk.Guardian): guardian_risk.Guardian;
|
|
20
|
+
|
|
21
|
+
export { type BrowserPluginOptions, browserPlugin, collectSignals };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
function browserPlugin(options = {}) {
|
|
3
|
+
const { container = "document" } = options;
|
|
4
|
+
return {
|
|
5
|
+
name: "guardian-risk-browser",
|
|
6
|
+
install(_guardian) {
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function collectSignals(guardian) {
|
|
11
|
+
return guardian.signal("signalSource", "browser").signal("browserPlugin", "stub");
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { browserPlugin, collectSignals };
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";AAcO,SAAS,aAAA,CAAc,OAAA,GAAgC,EAAC,EAAW;AACxE,EAAA,MAAM,EAAE,SAAA,GAAY,UAAA,EAAW,GAAI,OAAA;AAEnC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,uBAAA;AAAA,IACN,QAAQ,SAAA,EAAW;AACZ,IAEP;AAAA,GACF;AACF;AAKO,SAAS,eACd,QAAA,EACkC;AAClC,EAAA,OAAO,SACJ,MAAA,CAAO,cAAA,EAAgB,SAAS,CAAA,CAChC,MAAA,CAAO,iBAAiB,MAAM,CAAA;AACnC","file":"index.js","sourcesContent":["import type { Plugin } from 'guardian-risk';\n\n/** Options for the browser plugin (stub). */\nexport interface BrowserPluginOptions {\n /** DOM element to attach behavioral collectors. Defaults to document. */\n readonly container?: string;\n}\n\n/**\n * Browser plugin for guardian-risk.\n *\n * @stub Future versions will collect mouse, keyboard, and fingerprint signals\n * in the page and add them to Guardian before analysis.\n */\nexport function browserPlugin(options: BrowserPluginOptions = {}): Plugin {\n const { container = 'document' } = options;\n\n return {\n name: 'guardian-risk-browser',\n install(_guardian) {\n void container;\n // Stub: collectors will attach listeners and call guardian.signal()\n },\n };\n}\n\n/**\n * @stub Future helper to start client-side signal collection.\n */\nexport function collectSignals(\n guardian: import('guardian-risk').Guardian,\n): import('guardian-risk').Guardian {\n return guardian\n .signal('signalSource', 'browser')\n .signal('browserPlugin', 'stub');\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "guardian-risk-browser",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Browser plugin for guardian-risk — collects behavioral and fingerprint signals",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./dist/index.d.cts",
|
|
17
|
+
"default": "./dist/index.cjs"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"README.md",
|
|
25
|
+
"LICENSE"
|
|
26
|
+
],
|
|
27
|
+
"keywords": [
|
|
28
|
+
"guardian-risk",
|
|
29
|
+
"guardian-risk-browser",
|
|
30
|
+
"browser",
|
|
31
|
+
"fingerprint",
|
|
32
|
+
"bot-detection",
|
|
33
|
+
"risk"
|
|
34
|
+
],
|
|
35
|
+
"license": "MIT",
|
|
36
|
+
"repository": {
|
|
37
|
+
"type": "git",
|
|
38
|
+
"url": "git+https://github.com/himanshu6306singh/guardian-risk.git",
|
|
39
|
+
"directory": "packages/browser"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://github.com/himanshu6306singh/guardian-risk/tree/main/packages/browser#readme",
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/himanshu6306singh/guardian-risk/issues"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"guardian-risk": "^0.2.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"tsup": "^8.3.5",
|
|
53
|
+
"typescript": "^5.7.2",
|
|
54
|
+
"guardian-risk": "0.2.0"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsup",
|
|
58
|
+
"typecheck": "tsc --noEmit"
|
|
59
|
+
}
|
|
60
|
+
}
|