@trustsig/types 1.0.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 ADDED
@@ -0,0 +1,13 @@
1
+ # @trustsig/types
2
+
3
+ Shared TypeScript interfaces for the TrustSig SDK packages.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @trustsig/types
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ This package is internally used by `@trustsig/client`, `@trustsig/server`, and `@trustsig/react`. You typically do not need to install this directly unless you are building custom tooling around the TrustSig ecosystem.
package/package.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@trustsig/types",
3
+ "version": "1.0.0",
4
+ "main": "./dist/index.js",
5
+ "module": "./dist/index.mjs",
6
+ "types": "./dist/index.d.ts",
7
+ "scripts": { "build": "tsup" }
8
+ }
package/src/index.ts ADDED
@@ -0,0 +1,22 @@
1
+ export interface TrustSigOptions {
2
+ secretKey: string;
3
+ endpoint?: string;
4
+ }
5
+
6
+ export interface BotAnalysisResponse {
7
+ is_bot: boolean;
8
+ score: number;
9
+ action: string;
10
+ request_id: string;
11
+ factors: string[];
12
+ evidence: Record<string, any>;
13
+ site_key: string;
14
+ }
15
+
16
+ declare global {
17
+ interface Window {
18
+ TrustSig: {
19
+ getResponse: () => Promise<string | null>;
20
+ };
21
+ }
22
+ }
package/tsup.config.ts ADDED
@@ -0,0 +1,2 @@
1
+ import { defineConfig } from 'tsup';
2
+ export default defineConfig({ entry: ['src/index.ts'], format: ['cjs', 'esm'], dts: true, clean: true });