@vettly/react 0.1.13 → 0.1.15

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
@@ -1,6 +1,6 @@
1
1
  # @vettly/react
2
2
 
3
- React components for content moderation. Real-time feedback as users type.
3
+ React components for Vettly decision infrastructure. Governed decisions with real-time policy feedback.
4
4
 
5
5
  ## Installation
6
6
 
@@ -75,15 +75,6 @@ function CustomInput() {
75
75
  }
76
76
  ```
77
77
 
78
- ## Pricing
79
-
80
- | Plan | Price | Text | Images | Videos |
81
- |------|-------|------|--------|--------|
82
- | Developer | Free | 2,000/mo | 100/mo | 25/mo |
83
- | Growth | $49/mo | 50,000/mo | 5,000/mo | 1,000/mo |
84
- | Pro | $149/mo | 250,000/mo | 25,000/mo | 5,000/mo |
85
- | Enterprise | Custom | Unlimited | Unlimited | Unlimited |
86
-
87
78
  ## Links
88
79
 
89
80
  - [vettly.dev](https://vettly.dev) - Sign up
package/dist/index.cjs CHANGED
@@ -36,6 +36,7 @@ function useModeration(options) {
36
36
  policyId,
37
37
  debounceMs = 500,
38
38
  enabled = true,
39
+ useFast = false,
39
40
  onCheck,
40
41
  onError
41
42
  } = options;
@@ -79,7 +80,7 @@ function useModeration(options) {
79
80
  try {
80
81
  abortControllerRef.current = new AbortController();
81
82
  const checkRequest = typeof content === "string" ? { content, policyId, contentType: "text" } : { ...content, policyId };
82
- const response = await clientRef.current.check(checkRequest);
83
+ const response = useFast ? await clientRef.current.checkFast(checkRequest) : await clientRef.current.check(checkRequest);
83
84
  setResult({
84
85
  safe: response.safe,
85
86
  flagged: response.flagged,
@@ -105,7 +106,7 @@ function useModeration(options) {
105
106
  }
106
107
  }, debounceMs);
107
108
  },
108
- [enabled, policyId, debounceMs, onCheck, onError]
109
+ [enabled, policyId, debounceMs, useFast, onCheck, onError]
109
110
  );
110
111
  (0, import_react.useEffect)(() => {
111
112
  return () => {
@@ -135,6 +136,7 @@ var ModeratedTextarea = (0, import_react2.forwardRef)(
135
136
  debounceMs = 500,
136
137
  showFeedback = true,
137
138
  blockUnsafe = false,
139
+ useFast = false,
138
140
  customFeedback,
139
141
  onModerationResult,
140
142
  onModerationError,
@@ -148,6 +150,7 @@ var ModeratedTextarea = (0, import_react2.forwardRef)(
148
150
  policyId,
149
151
  debounceMs,
150
152
  enabled: !disabled,
153
+ useFast,
151
154
  onCheck: onModerationResult,
152
155
  onError: onModerationError
153
156
  });
package/dist/index.d.cts CHANGED
@@ -19,6 +19,8 @@ interface UseModerationOptions {
19
19
  policyId: string;
20
20
  debounceMs?: number;
21
21
  enabled?: boolean;
22
+ /** Use the fast endpoint for sub-100ms responses */
23
+ useFast?: boolean;
22
24
  onCheck?: (result: CheckResponse) => void;
23
25
  onError?: (error: Error) => void;
24
26
  }
@@ -28,7 +30,7 @@ declare function useModeration(options: UseModerationOptions): {
28
30
  };
29
31
 
30
32
  /**
31
- * ModeratedTextarea - A textarea with real-time content moderation
33
+ * ModeratedTextarea - A textarea with real-time content decisions
32
34
  */
33
35
 
34
36
  interface ModeratedTextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange'> {
@@ -43,6 +45,8 @@ interface ModeratedTextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLT
43
45
  debounceMs?: number;
44
46
  showFeedback?: boolean;
45
47
  blockUnsafe?: boolean;
48
+ /** Use the fast endpoint for sub-100ms responses */
49
+ useFast?: boolean;
46
50
  customFeedback?: (result: {
47
51
  safe: boolean;
48
52
  flagged: boolean;
package/dist/index.d.ts CHANGED
@@ -19,6 +19,8 @@ interface UseModerationOptions {
19
19
  policyId: string;
20
20
  debounceMs?: number;
21
21
  enabled?: boolean;
22
+ /** Use the fast endpoint for sub-100ms responses */
23
+ useFast?: boolean;
22
24
  onCheck?: (result: CheckResponse) => void;
23
25
  onError?: (error: Error) => void;
24
26
  }
@@ -28,7 +30,7 @@ declare function useModeration(options: UseModerationOptions): {
28
30
  };
29
31
 
30
32
  /**
31
- * ModeratedTextarea - A textarea with real-time content moderation
33
+ * ModeratedTextarea - A textarea with real-time content decisions
32
34
  */
33
35
 
34
36
  interface ModeratedTextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange'> {
@@ -43,6 +45,8 @@ interface ModeratedTextareaProps extends Omit<React.TextareaHTMLAttributes<HTMLT
43
45
  debounceMs?: number;
44
46
  showFeedback?: boolean;
45
47
  blockUnsafe?: boolean;
48
+ /** Use the fast endpoint for sub-100ms responses */
49
+ useFast?: boolean;
46
50
  customFeedback?: (result: {
47
51
  safe: boolean;
48
52
  flagged: boolean;
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ function useModeration(options) {
7
7
  policyId,
8
8
  debounceMs = 500,
9
9
  enabled = true,
10
+ useFast = false,
10
11
  onCheck,
11
12
  onError
12
13
  } = options;
@@ -50,7 +51,7 @@ function useModeration(options) {
50
51
  try {
51
52
  abortControllerRef.current = new AbortController();
52
53
  const checkRequest = typeof content === "string" ? { content, policyId, contentType: "text" } : { ...content, policyId };
53
- const response = await clientRef.current.check(checkRequest);
54
+ const response = useFast ? await clientRef.current.checkFast(checkRequest) : await clientRef.current.check(checkRequest);
54
55
  setResult({
55
56
  safe: response.safe,
56
57
  flagged: response.flagged,
@@ -76,7 +77,7 @@ function useModeration(options) {
76
77
  }
77
78
  }, debounceMs);
78
79
  },
79
- [enabled, policyId, debounceMs, onCheck, onError]
80
+ [enabled, policyId, debounceMs, useFast, onCheck, onError]
80
81
  );
81
82
  useEffect(() => {
82
83
  return () => {
@@ -106,6 +107,7 @@ var ModeratedTextarea = forwardRef(
106
107
  debounceMs = 500,
107
108
  showFeedback = true,
108
109
  blockUnsafe = false,
110
+ useFast = false,
109
111
  customFeedback,
110
112
  onModerationResult,
111
113
  onModerationError,
@@ -119,6 +121,7 @@ var ModeratedTextarea = forwardRef(
119
121
  policyId,
120
122
  debounceMs,
121
123
  enabled: !disabled,
124
+ useFast,
122
125
  onCheck: onModerationResult,
123
126
  onError: onModerationError
124
127
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vettly/react",
3
- "version": "0.1.13",
4
- "description": "Protect your users from harmful content. React components with real-time feedback.",
3
+ "version": "0.1.15",
4
+ "description": "React components for Vettly decision infrastructure. Content decisions with real-time feedback.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -25,12 +25,13 @@
25
25
  },
26
26
  "keywords": [
27
27
  "react",
28
+ "decision-infrastructure",
29
+ "content-decisions",
30
+ "policy-governance",
31
+ "audit-trail",
28
32
  "moderation",
29
33
  "content",
30
34
  "safety",
31
- "protection",
32
- "toxic",
33
- "harmful",
34
35
  "components",
35
36
  "ui",
36
37
  "textarea",
@@ -40,7 +41,7 @@
40
41
  "license": "MIT",
41
42
  "repository": {
42
43
  "type": "git",
43
- "url": "https://github.com/brian-nextaura/vettly-docs.git",
44
+ "url": "https://github.com/nextauralabs/vettly-docs.git",
44
45
  "directory": "packages/react"
45
46
  },
46
47
  "homepage": "https://vettly.dev",
@@ -48,15 +49,15 @@
48
49
  "access": "public"
49
50
  },
50
51
  "bugs": {
51
- "url": "https://github.com/brian-nextaura/vettly-docs/issues"
52
+ "url": "https://github.com/nextauralabs/vettly-docs/issues"
52
53
  },
53
54
  "peerDependencies": {
54
55
  "react": "^18.0.0",
55
56
  "react-dom": "^18.0.0"
56
57
  },
57
58
  "dependencies": {
58
- "@vettly/sdk": "workspace:*",
59
- "@vettly/shared": "workspace:*"
59
+ "@vettly/sdk": "^0.2.3",
60
+ "@vettly/shared": "^0.1.11"
60
61
  },
61
62
  "devDependencies": {
62
63
  "@types/bun": "latest",