@certivu/sdk 2.0.0 → 2.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/README.md +18 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,12 +24,13 @@ const certivu = new CertivuClient({
|
|
|
24
24
|
generatorId: 'gen_xyz',
|
|
25
25
|
})
|
|
26
26
|
|
|
27
|
-
// Sign AI-generated content — returns the
|
|
28
|
-
const { token, record_id,
|
|
29
|
-
content: imageBuffer, // Buffer or Uint8Array
|
|
27
|
+
// Sign AI-generated content — returns the signed file + token
|
|
28
|
+
const { token, record_id, signedContent } = await certivu.sign({
|
|
29
|
+
content: imageBuffer, // Buffer or Uint8Array (image, audio, or text)
|
|
30
30
|
model: 'stable-diffusion-xl',
|
|
31
|
+
format: 'image', // optional — auto-detected from magic bytes if omitted
|
|
31
32
|
})
|
|
32
|
-
//
|
|
33
|
+
// signedContent is a Uint8Array — serve this, it has provenance embedded
|
|
33
34
|
|
|
34
35
|
// Verify — token optional, extracted automatically from XMP or watermark
|
|
35
36
|
const result = await certivu.verify({ content: imageBuffer })
|
|
@@ -57,17 +58,22 @@ Get your API key and generator credentials at [dashboard.certivu.ai](https://das
|
|
|
57
58
|
|
|
58
59
|
### `certivu.sign(input)`
|
|
59
60
|
|
|
60
|
-
Signs AI-generated content server-side — watermarking, hashing, and ML-DSA signing all happen in the API. Returns the signed
|
|
61
|
+
Signs AI-generated content server-side — watermarking, hashing, and ML-DSA signing all happen in the API. Accepts images (JPEG/PNG/WebP), audio (MP3/FLAC/WAV), and text (PDF/HTML/plain text). Returns the signed file with provenance embedded.
|
|
61
62
|
|
|
62
63
|
```typescript
|
|
63
|
-
const { token, record_id,
|
|
64
|
-
content:
|
|
64
|
+
const { token, record_id, signedContent, format } = await certivu.sign({
|
|
65
|
+
content: fileBuffer, // Uint8Array | Buffer
|
|
65
66
|
model: 'stable-diffusion-xl', // model identifier
|
|
66
67
|
generatorId: 'gen_xyz', // overrides config.generatorId
|
|
68
|
+
format: 'image', // optional — 'image' | 'audio' | 'text', auto-detected if omitted
|
|
67
69
|
})
|
|
68
|
-
//
|
|
70
|
+
// signedContent — Uint8Array with provenance embedded (XMP / ID3 / meta tag / ZWC)
|
|
71
|
+
// format — the detected/confirmed format string
|
|
72
|
+
// watermarkedContent — alias for signedContent, kept for backwards compatibility
|
|
69
73
|
```
|
|
70
74
|
|
|
75
|
+
Upload limit: 50 MB.
|
|
76
|
+
|
|
71
77
|
---
|
|
72
78
|
|
|
73
79
|
### `certivu.verify(input)`
|
|
@@ -88,11 +94,13 @@ const result = await certivu.verify({
|
|
|
88
94
|
authentic: boolean,
|
|
89
95
|
tampered: boolean,
|
|
90
96
|
confidence: 'high' | 'medium' | 'low' | 'none',
|
|
91
|
-
token_source: 'provided' | 'xmp' | 'watermark',
|
|
97
|
+
token_source: 'provided' | 'xmp' | 'watermark' | 'phash',
|
|
98
|
+
format?: 'image' | 'audio' | 'text',
|
|
92
99
|
signals: {
|
|
93
100
|
watermark_found: boolean,
|
|
94
101
|
record_found: boolean,
|
|
95
102
|
signature_valid: boolean,
|
|
103
|
+
phash_match?: boolean,
|
|
96
104
|
},
|
|
97
105
|
provenance: {
|
|
98
106
|
org: string,
|
|
@@ -216,7 +224,7 @@ try {
|
|
|
216
224
|
| `402` | Quota exhausted (free tier) |
|
|
217
225
|
| `403` | Generator doesn't belong to your org |
|
|
218
226
|
| `404` | Generator not found or revoked |
|
|
219
|
-
| `413` | Upload exceeds
|
|
227
|
+
| `413` | Upload exceeds 50 MB limit |
|
|
220
228
|
|
|
221
229
|
---
|
|
222
230
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@certivu/sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Official SDK for Certivu — quantum-resistant AI content provenance",
|
|
5
5
|
"keywords": ["certivu", "ai", "provenance", "post-quantum", "ml-dsa", "watermark"],
|
|
6
6
|
"homepage": "https://certivu.ai",
|