@vettly/react 0.1.16 → 0.1.18

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.
Files changed (2) hide show
  1. package/README.md +44 -1
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,6 +1,41 @@
1
1
  # @vettly/react
2
2
 
3
- React components with real-time policy feedback and decision tracking. Same policies as your backend, instant user feedback.
3
+ React components for App Store Guideline 1.2 compliance. Real-time policy feedback, decision tracking, and moderated uploads.
4
+
5
+ ## App Store Guideline 1.2
6
+
7
+ Apple requires every iOS app with user-generated content to implement four things. This package handles the client-side UX for content filtering and audit trails — pair with `@vettly/sdk` on the server for reporting and blocking:
8
+
9
+ | Requirement | Guideline | React Integration |
10
+ |-------------|-----------|-------------------|
11
+ | **Content filtering** | 1.2.1 | `<ModeratedTextarea>`, `<ModeratedImageUpload>`, `<ModeratedVideoUpload>` |
12
+ | **User reporting** | 1.2.2 | Pair with server-side SDK (`POST /v1/reports`) |
13
+ | **User blocking** | 1.2.3 | Pair with server-side SDK (`POST /v1/blocks`) |
14
+ | **Audit trail** | — | Every check returns `decisionId` — store it with your content |
15
+
16
+ ### React Native / Expo
17
+
18
+ ```typescript
19
+ import { useModeration } from '@vettly/react'
20
+
21
+ function CommentInput() {
22
+ const { result, check } = useModeration({
23
+ apiKey: 'pk_live_...',
24
+ policyId: 'app-store',
25
+ })
26
+
27
+ return (
28
+ <TextInput
29
+ onChangeText={(text) => check(text)}
30
+ style={{
31
+ borderColor: result.action === 'block' ? 'red' : 'green'
32
+ }}
33
+ />
34
+ )
35
+ }
36
+ ```
37
+
38
+ > **Note:** Client-side moderation improves UX but is not a security boundary. Always validate on the server before persisting content.
4
39
 
5
40
  ## Why Client-Side Moderation?
6
41
 
@@ -578,6 +613,14 @@ export async function POST(req) {
578
613
 
579
614
  ---
580
615
 
616
+ ## Get Your API Key
617
+
618
+ 1. Sign up at [vettly.dev](https://vettly.dev)
619
+ 2. Go to Dashboard > API Keys
620
+ 3. Create and copy your **publishable key** (`pk_live_...`) for client-side use
621
+
622
+ ---
623
+
581
624
  ## Links
582
625
 
583
626
  - [vettly.dev](https://vettly.dev) - Sign up
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vettly/react",
3
- "version": "0.1.16",
4
- "description": "React components for Vettly decision infrastructure. Content decisions with real-time feedback.",
3
+ "version": "0.1.18",
4
+ "description": "React components for content moderation. ModeratedTextarea, ImageUpload, and VideoUpload with App Store compliance.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",