@chitmark/sdk 0.7.0 → 0.8.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 +20 -3
- package/dist/edge.cjs +575 -12
- package/dist/edge.cjs.map +1 -1
- package/dist/edge.d.cts +2 -2
- package/dist/edge.d.ts +2 -2
- package/dist/edge.js +558 -13
- package/dist/edge.js.map +1 -1
- package/dist/index.cjs +608 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +590 -13
- package/dist/index.js.map +1 -1
- package/dist/{trusted-ip-DnCZnqQx.d.cts → trusted-ip-BvSjdU80.d.cts} +458 -9
- package/dist/{trusted-ip-DnCZnqQx.d.ts → trusted-ip-BvSjdU80.d.ts} +458 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# @chitmark/sdk
|
|
2
2
|
|
|
3
|
-
Official TypeScript
|
|
3
|
+
Official TypeScript and JavaScript SDK for Chitmark.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- [Trust Decisions](https://chitmark.com/docs/quickstart/trust-decisions) lets you screen costly actions such as signups, credit grants, and API requests with `verify`, `feedback`, and `challenge`.
|
|
6
|
+
- [Agent Attribution](https://chitmark.com/docs/guides/agent-attribution) lets you recognize returning site sessions and evaluate signed proof from linked agents.
|
|
7
|
+
- [Agent Paid Access](https://chitmark.com/docs/guides/agent-paid-access) lets you buy or sell controlled access to API resources with hosted checkout and seller-controlled delivery.
|
|
6
8
|
|
|
7
9
|
[](https://www.npmjs.com/package/@chitmark/sdk)
|
|
8
10
|
|
|
@@ -18,7 +20,7 @@ pnpm add @chitmark/sdk
|
|
|
18
20
|
|
|
19
21
|
Requires Node >= 24. Runs on Node, browsers, Cloudflare Workers, and other edge runtimes (see the `/edge` entrypoint below).
|
|
20
22
|
|
|
21
|
-
##
|
|
23
|
+
## Trust Decisions quick start
|
|
22
24
|
|
|
23
25
|
```typescript
|
|
24
26
|
import { Chitmark } from "@chitmark/sdk";
|
|
@@ -172,6 +174,21 @@ const chitmark = new Chitmark({ apiKey: env.CHITMARK_API_KEY });
|
|
|
172
174
|
const verdict = await chitmark.verifyRequest(req, { action: "signup" });
|
|
173
175
|
```
|
|
174
176
|
|
|
177
|
+
## Agent Attribution
|
|
178
|
+
|
|
179
|
+
Use an Attribution read key to recognize site sessions or resolve an authorized principal association. Unknown is a successful outcome, and email is nullable.
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
const result = await chitmark.attribution.resolve({ request });
|
|
183
|
+
console.log(result.identity.recognized, result.principal.email);
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
See the [Agent Attribution guide](https://chitmark.com/docs/guides/agent-attribution/) for request adapters, link grants, and disclosure rules.
|
|
187
|
+
|
|
188
|
+
## Agent Paid Access
|
|
189
|
+
|
|
190
|
+
Call `chitmark.charge(request)` to request a quote, continue through hosted checkout, or check purchase status. Sellers use separate credentials to reserve execution and record delivery. See the [Agent Paid Access guide](https://chitmark.com/docs/guides/agent-paid-access) for scopes and a complete buyer and seller example.
|
|
191
|
+
|
|
175
192
|
## Agent integration
|
|
176
193
|
|
|
177
194
|
Using Cursor, Claude Code, Codex, or another coding agent? Point it at
|