insumer-verify 1.3.0 → 1.3.2
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 +17 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,6 +12,20 @@ Part of the InsumerAPI ecosystem: [REST API](https://insumermodel.com/developers
|
|
|
12
12
|
npm install insumer-verify
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
## Get an API Key
|
|
16
|
+
|
|
17
|
+
Generate one from your terminal — no browser needed:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
curl -s -X POST https://us-central1-insumer-merchant.cloudfunctions.net/createDeveloperApiKey \
|
|
21
|
+
-H "Content-Type: application/json" \
|
|
22
|
+
-d '{"email": "you@example.com", "appName": "insumer-verify", "tier": "free"}' | jq .
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Returns an `insr_live_...` key with 10 credits and 100 calls/day. One free key per email.
|
|
26
|
+
|
|
27
|
+
Or get one at [insumermodel.com/developers](https://insumermodel.com/developers/).
|
|
28
|
+
|
|
15
29
|
## Usage
|
|
16
30
|
|
|
17
31
|
Call InsumerAPI, get a signed attestation, verify it:
|
|
@@ -183,7 +197,9 @@ When `jwksUrl` is set, the library fetches the JWKS, matches the key by `kid` fr
|
|
|
183
197
|
|
|
184
198
|
| Parameter | Type | Description |
|
|
185
199
|
|-----------|------|-------------|
|
|
186
|
-
| `response` | `unknown` | Full InsumerAPI response (must contain `data.attestation` and `data.sig`) |
|
|
200
|
+
| `response` | `unknown` | Full InsumerAPI response envelope (must contain `data.attestation` and `data.sig`) |
|
|
201
|
+
|
|
202
|
+
> **Common mistake:** Pass the **full API response** (`await res.json()`), not `response.data` or `response.data.attestation`. The function expects the outer envelope `{ok, data: {attestation, sig, kid}, meta}`. Passing the inner `data` object will throw `"Invalid response: missing data object"`.
|
|
187
203
|
| `options.maxAge` | `number` | Optional max age in seconds for block freshness check |
|
|
188
204
|
| `options.jwksUrl` | `string` | Optional JWKS URL for dynamic key discovery (e.g. `https://insumermodel.com/.well-known/jwks.json`) |
|
|
189
205
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "insumer-verify",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "Client-side verifier for InsumerAPI attestations. ECDSA P-256 signatures, condition hashes, block freshness, expiry. Zero dependencies. Used by DJD Agent Score (Coinbase x402).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/index.js",
|