@nodatachat/sdk 1.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/LICENSE.md +105 -0
- package/README.md +177 -245
- package/dist/chunk-R62LOWK3.mjs +11 -0
- package/dist/index.d.mts +1008 -130
- package/dist/index.d.ts +1008 -130
- package/dist/index.js +11 -628
- package/dist/index.mjs +1 -8
- package/dist/plugins/express.d.mts +1 -1
- package/dist/plugins/express.d.ts +1 -1
- package/dist/plugins/express.js +11 -663
- package/dist/plugins/express.mjs +1 -43
- package/dist/plugins/fastify.d.mts +1 -1
- package/dist/plugins/fastify.d.ts +1 -1
- package/dist/plugins/fastify.js +11 -667
- package/dist/plugins/fastify.mjs +1 -47
- package/dist/{types-DQh0UmSr.d.mts → types-qXK35-os.d.mts} +132 -3
- package/dist/{types-DQh0UmSr.d.ts → types-qXK35-os.d.ts} +132 -3
- package/package.json +28 -22
- package/dist/chunk-V6GUTSNO.mjs +0 -601
package/README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
# @nodatachat/sdk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The developer SDK for **NoData, the Information Access Processor**.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Give AI access without giving it the data. One API. One decision. One proof.**
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The **primitive** is a single call — `compute(information, intent, clearance)` → a **decision** with an authorized view and a signed proof. The data the AI isn't cleared for never reaches the model. You pay per decision, and every decision *is* the proof.
|
|
8
|
+
|
|
9
|
+
Everything else in this SDK — capsules, documents, scan, engines — is an **adapter** that resolves to that same decision.
|
|
8
10
|
|
|
9
11
|
---
|
|
10
12
|
|
|
@@ -14,234 +16,186 @@ One package. Five lines. Full SOC compliance.
|
|
|
14
16
|
npm install @nodatachat/sdk
|
|
15
17
|
```
|
|
16
18
|
|
|
17
|
-
Zero dependencies. Works in Node.js, Bun, Deno, Cloudflare Workers, and any runtime with `fetch`.
|
|
19
|
+
Zero dependencies. Works in Node.js, Bun, Deno, Cloudflare Workers, and any runtime with `fetch`. Get a key at [nodatacapsule.com/capsule-api/register](https://www.nodatacapsule.com/capsule-api/register).
|
|
18
20
|
|
|
19
21
|
---
|
|
20
22
|
|
|
21
|
-
##
|
|
23
|
+
## The primitive — `compute()`
|
|
22
24
|
|
|
23
25
|
```ts
|
|
24
26
|
import { NoData } from '@nodatachat/sdk';
|
|
25
27
|
|
|
26
|
-
const nd = new NoData({ apiKey: '
|
|
28
|
+
const nd = new NoData({ apiKey: 'ndp_...' });
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
const { answer, sections, proof } = await nd.compute({
|
|
31
|
+
question: 'What is the claim status?',
|
|
32
|
+
clearance: 'internal',
|
|
33
|
+
sections: [
|
|
34
|
+
{ title: 'Status', text: 'Claim status: approved. Region: Tel Aviv.' },
|
|
35
|
+
{ title: 'Client', text: 'Dana Cohen, ID 039821582, amount 42,500 NIS.' },
|
|
36
|
+
],
|
|
32
37
|
});
|
|
33
38
|
|
|
34
|
-
//
|
|
39
|
+
// "Client" auto-classifies as confidential and is WITHHELD at internal clearance —
|
|
40
|
+
// it never reaches the model. `answer` comes only from "Status".
|
|
41
|
+
// sections → [{ title: 'Status', sent: true }, { title: 'Client', sent: false }]
|
|
35
42
|
|
|
36
|
-
//
|
|
37
|
-
const { value } = await nd.decrypt({
|
|
38
|
-
field: 'credit_card',
|
|
39
|
-
ciphertext,
|
|
40
|
-
requester: 'billing-service',
|
|
41
|
-
});
|
|
43
|
+
const v = await nd.verify(proof.id); // → { authentic: true, unaltered: true, ... }
|
|
42
44
|
```
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## What this does
|
|
46
|
+
Wire it to any model runtime — the pattern is always the same: **NoData decides + proves; your model only ever sees the authorized slice.**
|
|
49
47
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
```ts
|
|
49
|
+
// OpenAI / Anthropic / Gemini / LangChain / n8n — same shape:
|
|
50
|
+
const gate = await nd.compute({ question, clearance, sections });
|
|
51
|
+
if (gate.decision === 'deny') return 'Not authorized.';
|
|
52
|
+
const reply = gate.answer; // already computed over the authorized slice
|
|
53
|
+
// attach gate.proof.id to your response as the tamper-evident receipt.
|
|
54
|
+
```
|
|
57
55
|
|
|
58
56
|
---
|
|
59
57
|
|
|
60
|
-
##
|
|
61
|
-
|
|
62
|
-
```ts
|
|
63
|
-
const result = await nd.batchNative([
|
|
64
|
-
{ op: 'encrypt', field: 'phone', value: '0501234567' },
|
|
65
|
-
{ op: 'encrypt', field: 'email', value: 'david@company.com' },
|
|
66
|
-
{ op: 'encrypt', field: 'id', value: '123456789' },
|
|
67
|
-
{ op: 'decrypt', field: 'ssn', ciphertext: 'aes256gcm:v1:...' },
|
|
68
|
-
]);
|
|
69
|
-
// result.ok === 4, result.failed === 0
|
|
70
|
-
```
|
|
58
|
+
## Fabric — connect two organisations in a few lines — `nd.fabric`
|
|
71
59
|
|
|
72
|
-
|
|
60
|
+
Organisation A invites, organisation B accepts, and from then on each side sends the other **commands** (a named action and flat fields). Everything is sealed on the sender's machine and opened on the receiver's; NoData relays ciphertext it cannot read, decides every send, and signs a receipt for it.
|
|
73
61
|
|
|
74
62
|
```ts
|
|
75
|
-
|
|
76
|
-
name: 'David',
|
|
77
|
-
phone: '0501234567',
|
|
78
|
-
email: 'david@company.com',
|
|
79
|
-
address: { street: '123 Main', city: 'Tel Aviv' },
|
|
80
|
-
age: 30,
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const encrypted = await nd.encryptObject(customer, ['phone', 'email']);
|
|
84
|
-
// { name: 'David', phone: 'aes256gcm:v1:...', email: 'aes256gcm:v1:...', address: {...}, age: 30 }
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
---
|
|
63
|
+
import { NoData } from '@nodatachat/sdk';
|
|
88
64
|
|
|
89
|
-
|
|
65
|
+
const nd = new NoData({ apiKey: process.env.NODATA_API_KEY });
|
|
66
|
+
const fabric = await nd.fabric.open({ secret: process.env.NODATA_FABRIC_SECRET }); // nd.fabric.newSecret() once, then keep it
|
|
90
67
|
|
|
91
|
-
|
|
68
|
+
// Organisation A
|
|
69
|
+
const { url } = await fabric.invite({ note: 'Orders' }); // send the link to B
|
|
92
70
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
ttl: '1h',
|
|
97
|
-
requireVerification: true,
|
|
98
|
-
});
|
|
99
|
-
// Share ch.channel_token with System B
|
|
100
|
-
// Share ch.verification_code with the human approver
|
|
101
|
-
|
|
102
|
-
// System B — sends the data
|
|
103
|
-
await nd.channel.send({
|
|
104
|
-
token: ch.channel_token,
|
|
105
|
-
data: { card: '4111111111111111', cvv: '123', exp: '12/28' },
|
|
106
|
-
burnAfterRead: true,
|
|
107
|
-
});
|
|
71
|
+
// Organisation B
|
|
72
|
+
const acme = await fabric.accept(url); // connected, both ways
|
|
73
|
+
await fabric.send(acme, 'order.create', { sku: 'A-17', qty: 3 });
|
|
108
74
|
|
|
109
|
-
//
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
});
|
|
114
|
-
const card = JSON.parse(result.data);
|
|
75
|
+
// Organisation A
|
|
76
|
+
for (const m of await fabric.inbox({ accept: ['order.create'] })) {
|
|
77
|
+
if (m.status === 'accepted') await fabric.reply(m, 'order.ack', { ok: true });
|
|
78
|
+
}
|
|
115
79
|
```
|
|
116
80
|
|
|
117
|
-
|
|
81
|
+
- **Your key stays yours.** `open()` posts only the public half of the secret. Keep the secret like a password: it opens what is sent to you.
|
|
82
|
+
- **Commands, never files.** Between connected organisations only a command travels; the server refuses anything else and receipts the refusal.
|
|
83
|
+
- **You decide what you accept.** `inbox({ accept })` is your rule: other commands come back `refused`, without their fields.
|
|
84
|
+
- **Checked on arrival.** Before sealing, the recipient's key is checked against its address. Each message says whether what you opened matches the sender's commitment (`verified.committed`) and whether the relay's receipt is signed by one of NoData's pinned keys (`verified.receiptSignature`). `from` is the address the relay attributes, not a sender signature.
|
|
85
|
+
- **A person approves what needs a person.** When the organisation requires an approval, the call throws `FabricApprovalRequired` with `approveUrl`; call again with `approvalId` after a person approves. The SDK never approves.
|
|
86
|
+
- **Off switch.** `fabric.disconnect(partner)` ends the connection both ways; connecting again takes a new invitation.
|
|
87
|
+
- **One format.** What `nd.fabric` sends opens in the NoData console, CLI and MCP, and what they send opens here.
|
|
118
88
|
|
|
119
89
|
---
|
|
120
90
|
|
|
121
|
-
##
|
|
91
|
+
## Adapter — a customer capsule in a few calls
|
|
122
92
|
|
|
123
|
-
|
|
93
|
+
The capsule is one adapter over the primitive: an isolated, content-blind workspace per customer; every read is a governed decision with a receipt.
|
|
124
94
|
|
|
125
95
|
```ts
|
|
126
|
-
|
|
127
|
-
content: 'DATABASE_PASSWORD=s3cr3t_p@ss!',
|
|
128
|
-
ttl: '30m',
|
|
129
|
-
burn: true,
|
|
130
|
-
maxViews: 1,
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
console.log(d.delivery_url);
|
|
134
|
-
// https://www.nodatachat.com/d/abc123
|
|
135
|
-
// Opened once → gone forever
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
---
|
|
96
|
+
import { NoData } from '@nodatachat/sdk';
|
|
139
97
|
|
|
140
|
-
|
|
98
|
+
const nd = new NoData({ apiKey: 'ndp_...' });
|
|
141
99
|
|
|
142
|
-
|
|
100
|
+
// Mint a customer capsule (isolated, content-blind)
|
|
101
|
+
const cap = await nd.capsules.create({ handle: 'case-4471', display_name: 'Yossi Levy' });
|
|
143
102
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
103
|
+
// Seal a document in — a key per recipient
|
|
104
|
+
await cap.documents.add({
|
|
105
|
+
title: 'Policy',
|
|
106
|
+
sections: [
|
|
107
|
+
{ label: 'Summary', classification: 'public', text: 'Public summary.' },
|
|
108
|
+
{ label: 'Terms', classification: 'confidential', text: 'Confidential terms.' },
|
|
109
|
+
],
|
|
110
|
+
recipients: [{ email: 'client@acme.com', classifications: ['public'], code: 'blue-harbor' }],
|
|
148
111
|
});
|
|
149
112
|
|
|
150
|
-
//
|
|
151
|
-
|
|
113
|
+
// Grant a member access across the docs
|
|
114
|
+
await cap.members.add({ email: 'client@acme.com', classifications: ['public'], code: 'blue-harbor' });
|
|
152
115
|
|
|
153
|
-
//
|
|
154
|
-
const
|
|
116
|
+
// Signed audit ledger — who opened, when, on which device
|
|
117
|
+
const ledger = await cap.audit.get();
|
|
118
|
+
|
|
119
|
+
// Kill-switch: blocks the key capsule-wide — every live link 410s at once.
|
|
120
|
+
// Reversible (a paused capsule can be restored); use burn to crypto-shred the bytes.
|
|
121
|
+
await cap.revoke({ reason: 'offboarded' });
|
|
155
122
|
```
|
|
156
123
|
|
|
124
|
+
The server stores **ciphertext only** — never your section plaintext or the key.
|
|
125
|
+
|
|
157
126
|
---
|
|
158
127
|
|
|
159
|
-
##
|
|
128
|
+
## AI governance — let an agent read only what you allow
|
|
160
129
|
|
|
161
|
-
|
|
130
|
+
Grant a named agent scoped classifications; on read it gets back **only** those — denied sections never decrypt (deny-by-default), and every read is audited as an AI access.
|
|
162
131
|
|
|
163
132
|
```ts
|
|
164
|
-
const
|
|
165
|
-
field: 'credit_card',
|
|
166
|
-
action: 'decrypt',
|
|
167
|
-
from: '2026-03-01',
|
|
168
|
-
to: '2026-03-27',
|
|
169
|
-
});
|
|
133
|
+
const g = await cap.ai.grant({ agent_name: 'claims-bot', classifications: ['public'] });
|
|
170
134
|
|
|
171
|
-
|
|
135
|
+
const read = await cap.ai.read({ agent_id: g.agent_id });
|
|
136
|
+
// read.documents[].sections → 'public' only; 'confidential' is absent, never decrypted
|
|
137
|
+
|
|
138
|
+
await cap.ai.revoke(g.agent_id);
|
|
172
139
|
```
|
|
173
140
|
|
|
174
141
|
---
|
|
175
142
|
|
|
176
|
-
##
|
|
143
|
+
## Embedded Capsule — the white-label widget
|
|
177
144
|
|
|
178
|
-
|
|
145
|
+
Mint an origin-bound token for one of the capsule's documents and frame the viewer on your own site. The raw bearer never leaves NoData's origin — the token encrypts it.
|
|
179
146
|
|
|
180
147
|
```ts
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
metadata: { customer_id: 'cust_123' },
|
|
148
|
+
const { embed_url } = await cap.embed({
|
|
149
|
+
bearer: '<document bearer from documents.add>',
|
|
150
|
+
allowed_origin: 'https://portal.myfirm.com',
|
|
151
|
+
ttl_seconds: 3600,
|
|
186
152
|
});
|
|
187
|
-
|
|
188
|
-
const entry = await nd.vault.read(vault.vault_id);
|
|
189
|
-
const data = myDecrypt(entry.encrypted_blob, entry.iv, myKey);
|
|
153
|
+
// <iframe src={embed_url} />
|
|
190
154
|
```
|
|
191
155
|
|
|
192
156
|
---
|
|
193
157
|
|
|
194
|
-
##
|
|
158
|
+
## Tenants — provision a whole organization
|
|
195
159
|
|
|
196
160
|
```ts
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
const app = express();
|
|
201
|
-
|
|
202
|
-
app.use('/api/customers', nodataExpress({
|
|
203
|
-
apiKey: 'sk_live_...',
|
|
204
|
-
encryptFields: ['phone', 'email', 'id_number'],
|
|
205
|
-
decryptFields: ['phone', 'email'],
|
|
206
|
-
decryptHeader: 'X-NoData-Decrypt',
|
|
207
|
-
}));
|
|
208
|
-
|
|
209
|
-
app.get('/api/customers', async (req, res) => {
|
|
210
|
-
const rows = await db.query('SELECT * FROM customers');
|
|
211
|
-
res.json(rows);
|
|
212
|
-
// phone, email, id_number → automatically encrypted in response
|
|
213
|
-
});
|
|
161
|
+
const t = await nd.tenants.create({ company_name: 'Acme', slug: 'acme', capsule_install: true });
|
|
162
|
+
const state = await nd.tenants.get(t.tenant_id);
|
|
214
163
|
```
|
|
215
164
|
|
|
216
|
-
|
|
165
|
+
Requires a key with the `partner.provision_tenants` scope.
|
|
217
166
|
|
|
218
167
|
---
|
|
219
168
|
|
|
220
|
-
##
|
|
221
|
-
|
|
222
|
-
Your master key creates restricted child keys for each service:
|
|
169
|
+
## Fleet overview — you manage a fleet, not a capsule
|
|
223
170
|
|
|
224
171
|
```ts
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
method: 'POST',
|
|
228
|
-
headers: { Authorization: 'Bearer sk_live_MASTER_KEY' },
|
|
229
|
-
body: JSON.stringify({
|
|
230
|
-
name: 'payment-service',
|
|
231
|
-
scopes: ['encrypt', 'decrypt'],
|
|
232
|
-
rate_limit_per_minute: 500,
|
|
233
|
-
daily_quota: 100000,
|
|
234
|
-
expires_in_days: 90,
|
|
235
|
-
allowed_ips: ['10.0.0.0/8'],
|
|
236
|
-
}),
|
|
237
|
-
});
|
|
238
|
-
// { key: "svc_live_abc123..." } — shown ONCE
|
|
172
|
+
const fleet = await nd.capsules.overview();
|
|
173
|
+
// { fleet: { active_vaults, total_documents, ... }, ai_governance: { agents, grants_active } }
|
|
239
174
|
```
|
|
240
175
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Capsule API reference
|
|
179
|
+
|
|
180
|
+
| Method | Endpoint | What it does |
|
|
181
|
+
|--------|----------|--------------|
|
|
182
|
+
| `nd.capsules.create(req)` | `POST /v1/capsules` | Mint a customer capsule |
|
|
183
|
+
| `nd.capsules.list(opts?)` | `GET /v1/capsules` | List this org's capsules |
|
|
184
|
+
| `nd.capsules.get(idOrSlug)` | `GET /v1/capsules/{id}` | Capsule summary |
|
|
185
|
+
| `cap.documents.add(req)` | `POST /v1/capsules/{id}/documents` | Seal a document in |
|
|
186
|
+
| `cap.documents.list()` | `GET /v1/capsules/{id}/documents` | List documents (metadata) |
|
|
187
|
+
| `cap.members.add(req)` | `POST /v1/capsules/{id}/members` | Grant a member access |
|
|
188
|
+
| `cap.members.list()` | `GET /v1/capsules/{id}/members` | The member roster |
|
|
189
|
+
| `cap.ai.grant(req)` | `POST /v1/capsules/{id}/ai-grants` | Grant an AI agent scoped classifications |
|
|
190
|
+
| `cap.ai.list()` | `GET /v1/capsules/{id}/ai-grants` | List grants (allowed vs denied) |
|
|
191
|
+
| `cap.ai.read(req)` | `POST /v1/capsules/{id}/ai-read` | Agent reads only its allowed classifications |
|
|
192
|
+
| `cap.ai.revoke(id)` | `POST /v1/capsules/{id}/ai-grants` | Revoke an agent |
|
|
193
|
+
| `cap.audit.get(opts?)` | `GET /v1/capsules/{id}/audit` | Signed audit ledger |
|
|
194
|
+
| `cap.embed(req)` | `POST /v1/capsules/{id}/embed-token` | Origin-bound embed token |
|
|
195
|
+
| `cap.revoke(opts?)` | `POST /v1/capsules/{id}/revoke` | Kill-switch — every live link 410s at once (reversible) |
|
|
196
|
+
| `nd.tenants.create(req)` | `POST /v1/tenants` | Provision a tenant |
|
|
197
|
+
| `nd.tenants.get(id)` | `GET /v1/tenants/{id}` | Read tenant state |
|
|
198
|
+
| `nd.capsules.overview()` | `GET /v1/overview` | Fleet totals |
|
|
245
199
|
|
|
246
200
|
---
|
|
247
201
|
|
|
@@ -249,33 +203,27 @@ const svc = await fetch('https://www.nodatachat.com/api/v1/service-account', {
|
|
|
249
203
|
|
|
250
204
|
```ts
|
|
251
205
|
const nd = new NoData({
|
|
252
|
-
apiKey: '
|
|
253
|
-
baseUrl: 'https://www.
|
|
254
|
-
timeout: 30000,
|
|
255
|
-
retries: 2,
|
|
256
|
-
headers: { 'X-Custom': 'value' },
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
onResponse: (url, status, ms) => console.log(`← ${status} ${ms}ms`),
|
|
261
|
-
onError: (url, err) => console.error(`! ${url}: ${err.message}`),
|
|
206
|
+
apiKey: 'ndp_...',
|
|
207
|
+
baseUrl: 'https://www.nodatacapsule.com', // default
|
|
208
|
+
timeout: 30000, // ms
|
|
209
|
+
retries: 2, // on 5xx / network error
|
|
210
|
+
headers: { 'X-Custom': 'value' },
|
|
211
|
+
onRequest: (url, init) => console.log(`→ ${url}`),
|
|
212
|
+
onResponse: (url, status, ms) => console.log(`← ${status} ${ms}ms`),
|
|
213
|
+
onError: (url, err) => console.error(`! ${url}: ${err.message}`),
|
|
262
214
|
});
|
|
263
215
|
```
|
|
264
216
|
|
|
265
|
-
---
|
|
266
|
-
|
|
267
217
|
## Error handling
|
|
268
218
|
|
|
269
219
|
```ts
|
|
270
220
|
import { NoData, NoDataError } from '@nodatachat/sdk';
|
|
271
221
|
|
|
272
222
|
try {
|
|
273
|
-
await nd.
|
|
223
|
+
await nd.capsules.create({ handle: 'case-4471' });
|
|
274
224
|
} catch (err) {
|
|
275
225
|
if (err instanceof NoDataError) {
|
|
276
|
-
console.log(err.status);
|
|
277
|
-
console.log(err.message); // "Rate limit exceeded"
|
|
278
|
-
console.log(err.retryAfter); // 45 (seconds)
|
|
226
|
+
console.log(err.status, err.message, err.retryAfter);
|
|
279
227
|
}
|
|
280
228
|
}
|
|
281
229
|
```
|
|
@@ -284,102 +232,86 @@ Rate limits are handled automatically — the SDK waits and retries on 429.
|
|
|
284
232
|
|
|
285
233
|
---
|
|
286
234
|
|
|
287
|
-
##
|
|
235
|
+
## Platform Engines — `nd.engines.*`
|
|
288
236
|
|
|
289
|
-
|
|
237
|
+
The shared machinery beneath the capsule (and beneath File / Code / AI / Data Capsule). These are the **engines**, not the pitch — the way Stripe doesn't put its internal ledger in the hero. Reach for them directly only when you need the raw primitive.
|
|
290
238
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
| `nd.decrypt(req)` | Decrypt a single field |
|
|
295
|
-
| `nd.batchEncrypt(fields)` | Parallel encrypt (N HTTP calls) |
|
|
296
|
-
| `nd.batchDecrypt(fields)` | Parallel decrypt (N HTTP calls) |
|
|
297
|
-
| `nd.batchNative(items)` | Single-call batch (1 HTTP call, up to 100 ops) |
|
|
298
|
-
| `nd.encryptObject(obj, fields)` | Deep-walk encrypt matching fields |
|
|
299
|
-
| `nd.decryptObject(obj, fields)` | Deep-walk decrypt matching fields |
|
|
300
|
-
| `nd.ping()` | Health check + latency |
|
|
301
|
-
|
|
302
|
-
### Channels
|
|
303
|
-
|
|
304
|
-
| Method | Description |
|
|
305
|
-
|--------|------------|
|
|
306
|
-
| `nd.channel.create(opts)` | Create encrypted channel |
|
|
307
|
-
| `nd.channel.send(req)` | Send data through channel |
|
|
308
|
-
| `nd.channel.receive(req)` | Receive data from channel |
|
|
309
|
-
| `nd.channel.verify(token, code)` | Verify recipient |
|
|
310
|
-
| `nd.channel.proof(token)` | Get delivery proof |
|
|
239
|
+
```ts
|
|
240
|
+
// Blind Relay — field-level encrypt/decrypt (server stores nothing)
|
|
241
|
+
const { ciphertext } = await nd.engines.blindRelay.encrypt({ field: 'credit_card', value: '4111...' });
|
|
311
242
|
|
|
312
|
-
|
|
243
|
+
// Governance — register data + grant/revoke agents (runs on Excel/DB/CRM too)
|
|
244
|
+
await nd.engines.governance.grant(/* ... */);
|
|
313
245
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
| `nd.webhook.create(opts)` | Create webhook channel |
|
|
317
|
-
| `nd.webhook.events(token)` | Poll encrypted events |
|
|
318
|
-
| `nd.webhook.list()` | List all channels |
|
|
246
|
+
// Channel — system-to-system encrypted transfer
|
|
247
|
+
const ch = await nd.engines.channel.create({ ttl: '1h' });
|
|
319
248
|
|
|
320
|
-
|
|
249
|
+
// Delivery — burn-after-read
|
|
250
|
+
await nd.engines.deliver.send({ content: 'API_KEY=...', burn: true });
|
|
321
251
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
| `nd.deliver.send(req)` | Burn-after-read delivery |
|
|
325
|
-
| `nd.deliver.burn(content)` | Anonymous burn drop |
|
|
326
|
-
| `nd.deliver.read(dropId)` | Read + self-destruct |
|
|
252
|
+
// Evidence — audit trail + proofs
|
|
253
|
+
await nd.engines.evidence.query({ field: 'credit_card' });
|
|
327
254
|
|
|
328
|
-
|
|
255
|
+
// Vault — zero-knowledge blob storage · Webhooks — encrypted at rest
|
|
256
|
+
await nd.engines.vault.create({ /* ... */ });
|
|
257
|
+
await nd.engines.webhook.create({ label: 'stripe' });
|
|
258
|
+
```
|
|
329
259
|
|
|
330
|
-
|
|
|
331
|
-
|
|
332
|
-
| `nd.
|
|
333
|
-
| `nd.
|
|
334
|
-
| `nd.
|
|
260
|
+
| Engine | Namespace | Purpose |
|
|
261
|
+
|--------|-----------|---------|
|
|
262
|
+
| Governance | `nd.engines.governance.*` | Data permissions — register, grant, revoke (product-independent) |
|
|
263
|
+
| Blind Relay | `nd.engines.blindRelay.*` | `encrypt` / `decrypt` / batch — field-level, server-blind |
|
|
264
|
+
| Channel | `nd.engines.channel.*` | Encrypted system-to-system transfer |
|
|
265
|
+
| Delivery | `nd.engines.deliver.*` | Burn-after-read secret delivery |
|
|
266
|
+
| Evidence | `nd.engines.evidence.*` | Audit trail + cryptographic proofs |
|
|
267
|
+
| Vault | `nd.engines.vault.*` | Zero-knowledge blob storage |
|
|
268
|
+
| Webhooks | `nd.engines.webhook.*` | Receive webhooks, encrypted at rest |
|
|
335
269
|
|
|
336
|
-
|
|
270
|
+
> The old top-level accessors (`nd.encrypt`, `nd.channel`, `nd.governance`, …) still work but are **deprecated** — use `nd.engines.*`.
|
|
337
271
|
|
|
338
|
-
|
|
339
|
-
|--------|------------|
|
|
340
|
-
| `nd.vault.create(req)` | Store encrypted blob |
|
|
341
|
-
| `nd.vault.read(id)` | Retrieve encrypted blob |
|
|
342
|
-
| `nd.vault.delete(id)` | Delete entry |
|
|
343
|
-
| `nd.vault.status()` | Storage stats |
|
|
272
|
+
Framework plugins are available: `@nodatachat/sdk/express` and `@nodatachat/sdk/fastify`.
|
|
344
273
|
|
|
345
274
|
---
|
|
346
275
|
|
|
347
276
|
## Architecture
|
|
348
277
|
|
|
349
278
|
```
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
│
|
|
353
|
-
│ plaintext │
|
|
354
|
-
│ lives here │
|
|
355
|
-
│ │
|
|
356
|
-
└─────────────┘
|
|
279
|
+
one capsule per customer
|
|
280
|
+
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
|
|
281
|
+
│ Your App │ ─────→ │ NoData API │ ─────→ │ Your world │
|
|
282
|
+
│ plaintext │ │ ciphertext │ │ ciphertext │
|
|
283
|
+
│ lives here │ │ content- │ │ + receipts │
|
|
284
|
+
│ │ │ blind · 0 │ │ │
|
|
285
|
+
└─────────────┘ └──────────────┘ └─────────────┘
|
|
286
|
+
Capsule = the entity · Engines = the machinery underneath
|
|
357
287
|
```
|
|
358
288
|
|
|
359
|
-
**
|
|
289
|
+
**Content-blind by design — not by policy, by architecture.** We store ciphertext; never your data, never the key. A zero-knowledge capsule is sealed to a key only your customer holds, so we can never unwrap it.
|
|
360
290
|
|
|
361
291
|
---
|
|
362
292
|
|
|
363
|
-
##
|
|
293
|
+
## Get your API key
|
|
364
294
|
|
|
365
|
-
|
|
295
|
+
**[nodatacapsule.com/vault-api](https://www.nodatacapsule.com/vault-api)**
|
|
366
296
|
|
|
367
|
-
|
|
368
|
-
- **No key storage** — you hold the keys
|
|
369
|
-
- **No data retention** — we're a relay, not a warehouse
|
|
370
|
-
- **Full audit trail** — every operation logged (metadata only)
|
|
371
|
-
- **SOC 2 ready** — evidence endpoint = auditor-friendly
|
|
297
|
+
---
|
|
372
298
|
|
|
373
|
-
|
|
299
|
+
## NoData on npm
|
|
374
300
|
|
|
375
|
-
|
|
301
|
+
- **`@nodatachat/nodata`**: the main package, with all protection, scanning and governance capabilities, from the terminal.
|
|
302
|
+
- **`@nodatachat/sdk`** (this one): integration for developers.
|
|
303
|
+
- **`@nodatachat/mcp`**: integration for AI agents and MCP clients.
|
|
376
304
|
|
|
377
|
-
##
|
|
305
|
+
## License
|
|
378
306
|
|
|
379
|
-
|
|
307
|
+
[FSL-1.1-ALv2](LICENSE.md) (Functional Source License 1.1, Apache 2.0 future license).
|
|
308
|
+
Use it for any purpose except a competing product or service. Each release becomes
|
|
309
|
+
available under the Apache License 2.0 two years after it is published. Version 1.0.0
|
|
310
|
+
was published under MIT and remains available under that license.
|
|
311
|
+
Copyright 2026 Capsule Ltd.
|
|
380
312
|
|
|
381
313
|
---
|
|
382
314
|
|
|
383
315
|
<p align="center">
|
|
384
|
-
<strong>NoData</strong> —
|
|
316
|
+
<strong>NoData Capsule</strong> — one API mints a customer capsule.
|
|
385
317
|
</p>
|