@truesift/express 0.1.0 → 0.1.1

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 +294 -241
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -4,13 +4,15 @@
4
4
 
5
5
  Server-side TypeScript SDK client for the TrueSift human verification API.
6
6
 
7
- This package is designed for Node.js and Express backend environments. It can also be used in other server-side Node.js runtimes, as long as secrets remain strictly backend-only.
7
+ `@truesift/express` is designed for backend environments such as Express, Node.js services, and server-side route handlers. It must not be imported into browser/client code.
8
8
 
9
- > Status: internal work in progress
10
- > Version: 0.1.0
11
- > Runtime: Node.js 20+
12
- > Module format: ESM
13
- > Language: TypeScript
9
+ ```txt
10
+ Package: @truesift/express
11
+ Runtime: Node.js 20+
12
+ Module format: ESM
13
+ Language: TypeScript
14
+ License: MIT
15
+ ```
14
16
 
15
17
  ---
16
18
 
@@ -18,9 +20,7 @@ This package is designed for Node.js and Express backend environments. It can al
18
20
 
19
21
  The SDK provides a small, typed, predictable service client for communicating with the TrueSift API.
20
22
 
21
- It is intentionally thin.
22
-
23
- The SDK should help backend projects:
23
+ It helps backend projects:
24
24
 
25
25
  - create verification challenges
26
26
  - verify submitted challenges
@@ -29,6 +29,8 @@ The SDK should help backend projects:
29
29
  - handle transport and API errors consistently
30
30
  - keep secret credentials out of frontend code
31
31
 
32
+ The SDK is intentionally thin. It does not own your application logic.
33
+
32
34
  ---
33
35
 
34
36
  ## What this SDK is not
@@ -37,7 +39,7 @@ This SDK is not:
37
39
 
38
40
  - a frontend SDK
39
41
  - a React package
40
- - a Next.js framework adapter
42
+ - a Next.js client package
41
43
  - a UI package
42
44
  - an Express application
43
45
  - an Express router
@@ -47,7 +49,7 @@ This SDK is not:
47
49
  - a policy engine
48
50
  - an admin dashboard client
49
51
 
50
- Project backends remain responsible for their own business logic, request handling, form validation, error responses, telemetry, fail-open/fail-closed behavior, and user-facing messages.
52
+ Your backend remains responsible for request handling, validation, storage, user-facing messages, telemetry, fail-open/fail-closed behavior, and business decisions.
51
53
 
52
54
  ---
53
55
 
@@ -61,41 +63,15 @@ Do not import this package in:
61
63
  - browser scripts
62
64
  - frontend bundles
63
65
  - public JavaScript
64
- - code that exposes secrets through `NEXT_PUBLIC_*` variables
65
-
66
- The SDK uses a `secretKey`, which must never leave the backend.
67
-
68
- ---
69
-
70
- ## Package name
71
-
72
- Current package identity:
73
-
74
- ```txt
75
- @truesift/express
76
- ```
77
-
78
- The package is currently marked as private and is not published yet.
79
-
80
- Possible future distribution options:
81
-
82
- - public npm package
83
- - private npm package
84
- - GitHub Packages
85
- - internal registry
86
- - own package server
87
- - local workspace package
66
+ - files using `NEXT_PUBLIC_*` secrets
67
+ - any code that can be shipped to the browser
88
68
 
89
- The SDK architecture is intentionally independent from the final publishing strategy.
69
+ The SDK uses a `secretKey`. That key must never leave the backend.
90
70
 
91
71
  ---
92
72
 
93
73
  ## Installation
94
74
 
95
- The package is not published yet.
96
-
97
- When published, installation will look like:
98
-
99
75
  ```bash
100
76
  pnpm add @truesift/express
101
77
  ```
@@ -106,168 +82,249 @@ or:
106
82
  npm install @truesift/express
107
83
  ```
108
84
 
109
- For local development, use the package directly from the project directory or through a workspace setup.
110
-
111
85
  ---
112
86
 
113
87
  ## Requirements
114
88
 
115
89
  ```txt
116
90
  Node.js >= 20.0.0
117
- TypeScript
118
91
  ESM runtime
119
92
  Server-side environment
120
93
  ```
121
94
 
122
95
  The SDK uses the native `fetch` available in modern Node.js versions.
123
96
 
124
- No browser runtime is targeted.
125
-
126
97
  ---
127
98
 
128
- ## Planned public API
99
+ ## Environment configuration
129
100
 
130
- The first stable SDK API is planned to expose:
101
+ The SDK does **not** automatically read `.env` files.
131
102
 
132
- ```ts
133
- createBotGuardClient(config)
134
- BotGuardClient
135
- client.createChallenge(input)
136
- client.verifyChallenge(input)
103
+ Your backend application must read and validate environment variables, then pass the resolved values to `createTrueSiftClient()` or `createBotGuardClient()`.
137
104
 
138
- isAllowed(result)
139
- isReview(result)
140
- isBlocked(result)
105
+ Recommended backend environment variables:
141
106
 
142
- BotGuardError
143
- BotGuardConfigError
144
- BotGuardRequestError
145
- BotGuardTimeoutError
146
- BotGuardAuthError
147
- BotGuardResponseError
148
- BotGuardApiError
107
+ ```env
108
+ TRUESIFT_API_BASE_URL=https://your-truesift-api.example.com/api/v1/botguard
109
+ TRUESIFT_SITE_KEY=site_xxxxxxxxxxxxxxxxxxxx
110
+ TRUESIFT_SECRET_KEY=secret_xxxxxxxxxxxxxxxxxxxx
111
+ TRUESIFT_DEFAULT_ORIGIN=https://www.example.com
112
+ TRUESIFT_DEFAULT_ACTION=website_check
113
+ TRUESIFT_TIMEOUT_MS=2500
114
+ TRUESIFT_FAIL_OPEN=true
149
115
  ```
150
116
 
151
- The internal product name is now TrueSift, but the technical API may still use `BotGuard` naming in early versions where it reflects the original backend module and locked architecture.
117
+ `TRUESIFT_FAIL_OPEN` is **not** an SDK option. It is a project-level policy flag. Your backend decides what to do when TrueSift is unavailable.
152
118
 
153
119
  ---
154
120
 
155
- ## Configuration
121
+ ## Where do the keys come from?
156
122
 
157
- Recommended project environment variables:
123
+ The SDK does not generate `siteKey` or `secretKey`.
158
124
 
159
- ```env
160
- TRUESIFT_API_BASE_URL=https://your-truesift-api.example.com/api/v1/botguard
161
- TRUESIFT_SITE_KEY=your_site_key
162
- TRUESIFT_SECRET_KEY=your_secret_key
163
- TRUESIFT_DEFAULT_ACTION=website_check
164
- TRUESIFT_DEFAULT_ORIGIN=https://www.example.com
165
- TRUESIFT_TIMEOUT_MS=2500
166
- TRUESIFT_FAIL_OPEN=true
125
+ They must be issued by the TrueSift service owner, admin panel, provisioning script, or trusted internal configuration process.
126
+
127
+ Typical provisioning model:
128
+
129
+ ```txt
130
+ 1. A site/application is registered in the TrueSift service.
131
+ 2. The service issues a siteKey and secretKey for that site.
132
+ 3. The backend stores these values in its private environment configuration.
133
+ 4. The backend creates the SDK client using these values.
134
+ 5. The frontend never receives the secretKey.
135
+ ```
136
+
137
+ Credential meaning:
138
+
139
+ ```txt
140
+ TRUESIFT_API_BASE_URL
141
+ Base URL of the TrueSift API service.
142
+
143
+ TRUESIFT_SITE_KEY
144
+ Site/application identifier. It identifies which protected site or app is making the request.
145
+
146
+ TRUESIFT_SECRET_KEY
147
+ Backend-only credential used to verify trusted server-side requests.
148
+
149
+ TRUESIFT_DEFAULT_ORIGIN
150
+ The default public origin of the protected site.
151
+
152
+ TRUESIFT_DEFAULT_ACTION
153
+ A stable action name such as website_check, contact_form, lead_form, ticket_public_submit.
154
+
155
+ TRUESIFT_TIMEOUT_MS
156
+ SDK request timeout in milliseconds. Recommended default: 2500.
157
+
158
+ TRUESIFT_FAIL_OPEN
159
+ Optional application policy. If true, your app may continue the business flow when TrueSift is unavailable.
167
160
  ```
168
161
 
169
- The SDK itself does not automatically read `.env` files.
162
+ Never create or hard-code fake production secrets in source code.
170
163
 
171
- Backend projects should read and validate their own environment variables, then pass a configuration object to the SDK.
164
+ ---
172
165
 
173
- Example:
166
+ ## Minimal backend configuration example
174
167
 
175
168
  ```ts
176
- import { createBotGuardClient } from '@truesift/express';
169
+ import { createTrueSiftClient } from '@truesift/express';
177
170
 
178
- const trueSiftClient = createBotGuardClient({
171
+ const trueSiftClient = createTrueSiftClient({
179
172
  apiBaseUrl: process.env.TRUESIFT_API_BASE_URL,
180
173
  siteKey: process.env.TRUESIFT_SITE_KEY,
181
174
  secretKey: process.env.TRUESIFT_SECRET_KEY,
182
- defaultAction: 'website_check',
183
- defaultOrigin: 'https://www.example.com',
184
- timeoutMs: 2500
175
+ defaultOrigin: process.env.TRUESIFT_DEFAULT_ORIGIN,
176
+ defaultAction: process.env.TRUESIFT_DEFAULT_ACTION,
177
+ timeoutMs: Number(process.env.TRUESIFT_TIMEOUT_MS ?? 2500),
185
178
  });
186
179
  ```
187
180
 
181
+ For production projects, validate these values with your existing config layer before creating the client.
182
+
188
183
  ---
189
184
 
190
- ## Secret key rules
185
+ ## Optional configuration pattern
191
186
 
192
- The `secretKey` is a backend-only credential.
187
+ For observe-mode or staged integrations, you may keep TrueSift optional in the host backend.
193
188
 
194
- Never:
189
+ Example policy:
195
190
 
196
- - send it to the browser
197
- - expose it through frontend environment variables
198
- - log it
199
- - include it in screenshots
200
- - include it in client payloads
201
- - store it in public repositories
202
- - return it from API responses
191
+ ```txt
192
+ if TrueSift config is missing:
193
+ do not create the SDK client
194
+ continue the main business flow
195
+ log a short non-secret warning in development only
196
+
197
+ if TrueSift request fails:
198
+ use project policy:
199
+ fail-open -> continue flow
200
+ fail-closed -> reject request
201
+ ```
203
202
 
204
- The SDK must redact sensitive values from error context and debug context.
203
+ This policy belongs to your backend application, not the SDK.
205
204
 
206
205
  ---
207
206
 
208
- ## Site key rules
207
+ ## Public API
209
208
 
210
- The `siteKey` is a public identifier by design, but this SDK treats it as server-side configuration.
209
+ Main client API:
211
210
 
212
- A backend project may decide whether the frontend ever needs to know a site key.
211
+ ```ts
212
+ createTrueSiftClient(config)
213
+ createBotGuardClient(config)
213
214
 
214
- For backend-driven flows, the frontend does not need direct access to the site key.
215
+ TrueSiftClient
216
+ BotGuardClient
215
217
 
216
- ---
218
+ client.createChallenge(input)
219
+ client.verifyChallenge(input)
220
+ ```
217
221
 
218
- ## Challenge flow
222
+ Decision helpers:
219
223
 
220
- The SDK does not decide where or when challenges are created.
224
+ ```ts
225
+ isAllowed(result)
226
+ isReview(result)
227
+ isBlocked(result)
221
228
 
222
- A project may create challenges:
229
+ isAllowedDecision(decision)
230
+ isReviewDecision(decision)
231
+ isBlockedDecision(decision)
223
232
 
224
- - when a page loads
225
- - when a form opens
226
- - immediately before submit
227
- - through a server-side session flow
228
- - through another project-specific flow
233
+ createDecisionFlags(decision)
234
+ normalizeDecision(value)
235
+ isTrueSiftDecision(value)
236
+ ```
229
237
 
230
- The SDK only provides the client operation.
238
+ Error classes:
231
239
 
232
- Conceptual usage:
240
+ ```ts
241
+ TrueSiftError
242
+ TrueSiftConfigError
243
+ TrueSiftRequestError
244
+ TrueSiftTimeoutError
245
+ TrueSiftAuthError
246
+ TrueSiftResponseError
247
+ TrueSiftApiError
248
+ ```
249
+
250
+ Compatibility aliases with the original technical BotGuard naming are also exported:
251
+
252
+ ```ts
253
+ BotGuardError
254
+ BotGuardConfigError
255
+ BotGuardRequestError
256
+ BotGuardTimeoutError
257
+ BotGuardAuthError
258
+ BotGuardResponseError
259
+ BotGuardApiError
260
+ ```
261
+
262
+ ---
263
+
264
+ ## Creating a challenge
233
265
 
234
266
  ```ts
235
267
  const challenge = await trueSiftClient.createChallenge({
236
- origin: 'https://www.example.com',
237
- action: 'website_check',
238
268
  path: '/website-check',
239
269
  metadata: {
240
- form: 'website-check'
241
- }
270
+ form: 'website-check',
271
+ },
242
272
  });
243
273
  ```
244
274
 
245
- ---
275
+ If `siteKey`, `origin`, or `action` are not provided in the input, the SDK uses the configured defaults.
246
276
 
247
- ## Verify flow
277
+ Expected successful result shape:
278
+
279
+ ```ts
280
+ {
281
+ success: true,
282
+ challengeId: string,
283
+ challengeToken: string,
284
+ expiresAt: string,
285
+ requestId?: string,
286
+ raw?: unknown
287
+ }
288
+ ```
248
289
 
249
- The SDK sends challenge data and client signals to the TrueSift API.
290
+ ---
250
291
 
251
- Conceptual usage:
292
+ ## Verifying a challenge
252
293
 
253
294
  ```ts
254
295
  const result = await trueSiftClient.verifyChallenge({
255
296
  challengeId: body.challengeId,
256
297
  challengeToken: body.challengeToken,
257
- origin: 'https://www.example.com',
258
- action: 'website_check',
259
298
  path: '/website-check',
260
299
  clientSignals: {
261
300
  elapsedMs: body.elapsedMs,
262
- honeypotValue: body.companyWebsite
301
+ honeypotValue: body.companyWebsite,
263
302
  },
264
303
  metadata: {
265
- form: 'website-check'
266
- }
304
+ form: 'website-check',
305
+ },
267
306
  });
268
307
  ```
269
308
 
270
- The SDK normalizes the response, but the project decides what to do next.
309
+ Expected successful result shape:
310
+
311
+ ```ts
312
+ {
313
+ success: true,
314
+ decision: 'allow' | 'review' | 'block',
315
+ score: number,
316
+ reasonCodes: string[],
317
+ isAllowed: boolean,
318
+ isReview: boolean,
319
+ isBlocked: boolean,
320
+ mode?: 'observe' | 'protect',
321
+ calculatedDecision?: 'allow' | 'review' | 'block',
322
+ effectiveDecision?: 'allow' | 'review' | 'block',
323
+ challengeId?: string,
324
+ requestId?: string,
325
+ raw?: unknown
326
+ }
327
+ ```
271
328
 
272
329
  ---
273
330
 
@@ -281,102 +338,95 @@ review
281
338
  block
282
339
  ```
283
340
 
284
- The SDK exposes helper functions:
285
-
286
- ```ts
287
- isAllowed(result)
288
- isReview(result)
289
- isBlocked(result)
290
- ```
291
-
292
- These helpers do not make business decisions.
341
+ A `block` decision is a valid business result, not a transport error.
293
342
 
294
- They only make backend code easier to read.
343
+ The SDK does not automatically block users. Your backend decides how to react.
295
344
 
296
345
  ---
297
346
 
298
- ## Fail-open and fail-closed
299
-
300
- The SDK does not decide whether a request should continue when TrueSift is unavailable.
347
+ ## Observe mode
301
348
 
302
- That decision belongs to the project backend.
349
+ In observe mode, TrueSift can return decisions without your application blocking users.
303
350
 
304
- Typical policies:
351
+ This is recommended for early integrations:
305
352
 
306
353
  ```txt
307
- fail-open:
308
- if TrueSift is unavailable, continue the business flow
309
-
310
- fail-closed:
311
- if TrueSift is unavailable, reject the request
354
+ 1. call verifyChallenge()
355
+ 2. record or inspect the decision
356
+ 3. continue the user flow
357
+ 4. only switch to protect behavior after enough confidence
312
358
  ```
313
359
 
314
- For early observe-mode integrations, fail-open is usually safer because real users should not be blocked by a temporary verification outage.
315
-
316
360
  ---
317
361
 
318
- ## Observe mode
362
+ ## Protect mode
319
363
 
320
- In observe mode, TrueSift can collect telemetry and return decisions without blocking real users.
364
+ In protect mode, your backend may act on `block` decisions.
321
365
 
322
- The SDK should return normalized result data.
366
+ Example policy:
323
367
 
324
- The project backend decides whether to ignore, store, review, or act on that result.
368
+ ```txt
369
+ allow -> continue
370
+ review -> continue, flag, or apply extra checks
371
+ block -> reject or slow down according to your business rules
372
+ ```
373
+
374
+ The SDK only returns normalized data. It does not enforce this policy.
325
375
 
326
376
  ---
327
377
 
328
- ## Protect mode
378
+ ## Fail-open and fail-closed
329
379
 
330
- In protect mode, TrueSift may return a block decision.
380
+ The SDK does not decide whether a request should continue when TrueSift is unavailable.
331
381
 
332
- A block decision is a valid business result, not a transport error.
382
+ Typical backend policies:
333
383
 
334
- The SDK must not throw an exception just because the decision is `block`.
384
+ ```txt
385
+ fail-open:
386
+ if TrueSift is unavailable, continue the business flow
335
387
 
336
- Transport errors are different and include:
388
+ fail-closed:
389
+ if TrueSift is unavailable, reject the request
390
+ ```
337
391
 
338
- - network failure
339
- - timeout
340
- - invalid JSON
341
- - unexpected response shape
342
- - HTTP 401
343
- - HTTP 5xx
344
- - malformed API response
392
+ For public lead forms, website checks, and early observe-mode integrations, fail-open is usually safer because real users should not be blocked by a temporary verification outage.
393
+
394
+ For sensitive endpoints, your backend may choose fail-closed.
345
395
 
346
396
  ---
347
397
 
348
398
  ## Error model
349
399
 
350
- The SDK distinguishes between several error classes:
400
+ The SDK distinguishes between these error classes:
351
401
 
352
402
  ```txt
353
- BotGuardConfigError
354
- BotGuardRequestError
355
- BotGuardTimeoutError
356
- BotGuardAuthError
357
- BotGuardResponseError
358
- BotGuardApiError
403
+ TrueSiftConfigError
404
+ TrueSiftRequestError
405
+ TrueSiftTimeoutError
406
+ TrueSiftAuthError
407
+ TrueSiftResponseError
408
+ TrueSiftApiError
359
409
  ```
360
410
 
361
- Expected meaning:
411
+ Meaning:
362
412
 
363
413
  ```txt
364
- BotGuardConfigError:
414
+ TrueSiftConfigError:
365
415
  missing or invalid SDK configuration
366
416
 
367
- BotGuardRequestError:
417
+ TrueSiftRequestError:
368
418
  network-level request failure
369
419
 
370
- BotGuardTimeoutError:
420
+ TrueSiftTimeoutError:
371
421
  request aborted after timeout
372
422
 
373
- BotGuardAuthError:
423
+ TrueSiftAuthError:
374
424
  API returned an authentication or authorization error
375
425
 
376
- BotGuardResponseError:
426
+ TrueSiftResponseError:
377
427
  API response was malformed or unexpected
378
428
 
379
- BotGuardApiError:
429
+ TrueSiftApiError:
380
430
  API returned a structured error response
381
431
  ```
382
432
 
@@ -394,23 +444,43 @@ Recommended default:
394
444
 
395
445
  The timeout is implemented with `AbortController`.
396
446
 
397
- The SDK must clean up timers correctly after each request.
447
+ The SDK does not retry requests automatically.
448
+
449
+ Important:
450
+
451
+ ```txt
452
+ verifyChallenge() must not be retried automatically
453
+ ```
454
+
455
+ Challenge tokens may be single-use. Retrying verification can produce incorrect behavior or falsely consume a token.
398
456
 
399
457
  ---
400
458
 
401
- ## Retry behavior
459
+ ## Secret key rules
460
+
461
+ The `secretKey` is a backend-only credential.
462
+
463
+ Never:
402
464
 
403
- The first SDK version does not retry requests by default.
465
+ - send it to the browser
466
+ - expose it through frontend environment variables
467
+ - log it
468
+ - include it in screenshots
469
+ - include it in client payloads
470
+ - store it in public repositories
471
+ - return it from API responses
404
472
 
405
- Especially important:
473
+ The SDK includes redaction helpers, but your application should still avoid logging full request bodies, headers, cookies, tokens, and environment dumps.
406
474
 
407
- ```txt
408
- verifyChallenge() must not be retried automatically
409
- ```
475
+ ---
476
+
477
+ ## Site key rules
478
+
479
+ The `siteKey` identifies a protected site/application.
410
480
 
411
- Challenge tokens may be single-use.
481
+ It is less sensitive than `secretKey`, but backend-driven integrations normally do not need to expose it to the frontend.
412
482
 
413
- Retrying verification can produce incorrect behavior or falsely consume a token.
483
+ If a future frontend challenge widget needs a public site key, expose only the site key and never the secret key.
414
484
 
415
485
  ---
416
486
 
@@ -429,18 +499,18 @@ Conceptual controller flow:
429
499
  4. Extract client signals
430
500
  5. Call verifyChallenge()
431
501
  6. If TrueSift transport error and project policy is fail-open:
432
- continue business flow and store telemetry if needed
502
+ continue business flow
433
503
  7. If result is blocked and project is in protect mode:
434
504
  return project-specific rejection response
435
505
  8. Otherwise:
436
- continue the normal business flow
506
+ continue normal business flow
437
507
  ```
438
508
 
439
509
  ---
440
510
 
441
511
  ## Next.js backend usage concept
442
512
 
443
- The same SDK may be used in Next.js route handlers, but this package must not import Next.js types.
513
+ The SDK may be used in Next.js route handlers, but this package must not import Next.js types.
444
514
 
445
515
  Conceptual flow:
446
516
 
@@ -449,7 +519,7 @@ app/api/some-form/route.ts
449
519
 
450
520
  server-only environment config
451
521
 
452
- createBotGuardClient()
522
+ createTrueSiftClient()
453
523
 
454
524
  verifyChallenge()
455
525
 
@@ -460,20 +530,27 @@ Do not import this SDK into client components.
460
530
 
461
531
  ---
462
532
 
463
- ## Security principles
533
+ ## Safe logging
464
534
 
465
- The SDK follows these principles:
535
+ Recommended logging behavior:
466
536
 
467
- - no default logging
468
- - no secret logging
469
- - no frontend usage
470
- - no browser bundle usage
471
- - no business policy decisions
472
- - no automatic Express middleware in the first version
473
- - no automatic retries for challenge verification
474
- - runtime response validation
475
- - strict TypeScript types
476
- - minimal dependencies
537
+ ```txt
538
+ development:
539
+ short warnings are acceptable
540
+ never log secretKey, challengeToken, cookies, authorization headers, or full request bodies
541
+
542
+ production:
543
+ log only high-level failure category, requestId, endpoint/action, and non-sensitive context
544
+ ```
545
+
546
+ The SDK exposes redaction helpers:
547
+
548
+ ```ts
549
+ redactTrueSiftClientConfig(config)
550
+ redactBotGuardConfig(config)
551
+ redactSensitiveRecord(record)
552
+ redactSensitiveValue(value)
553
+ ```
477
554
 
478
555
  ---
479
556
 
@@ -491,16 +568,16 @@ Run typecheck:
491
568
  pnpm typecheck
492
569
  ```
493
570
 
494
- Build package:
571
+ Run tests:
495
572
 
496
573
  ```bash
497
- pnpm build
574
+ pnpm test
498
575
  ```
499
576
 
500
- Run tests:
577
+ Build package:
501
578
 
502
579
  ```bash
503
- pnpm test
580
+ pnpm build
504
581
  ```
505
582
 
506
583
  Run all checks:
@@ -509,52 +586,28 @@ Run all checks:
509
586
  pnpm check
510
587
  ```
511
588
 
512
- ---
513
-
514
- ## Current build setup
515
-
516
- The package currently uses:
517
-
518
- ```txt
519
- TypeScript 6
520
- tsup
521
- Vitest
522
- Node.js 20 target
523
- ESM output
524
- DTS output
525
- ```
526
-
527
- The generated package output is written to:
589
+ Create package preview:
528
590
 
529
- ```txt
530
- dist/
591
+ ```bash
592
+ npm pack --dry-run
531
593
  ```
532
594
 
533
595
  ---
534
596
 
535
- ## Repository status
536
-
537
- This package directory may later become:
538
-
539
- - a standalone Git repository
540
- - part of a monorepo
541
- - a private npm package source
542
- - a public npm package source
543
- - an internal TrueSift SDK workspace
544
-
545
- The package is designed to remain reusable regardless of the final repository and publishing strategy.
546
-
547
- ---
548
-
549
- ## License
550
-
551
- This package is currently proprietary and unpublished.
597
+ ## Security principles
552
598
 
553
- See:
599
+ The SDK follows these principles:
554
600
 
555
- ```txt
556
- LICENSE
557
- ```
601
+ - server-side only
602
+ - no default logging
603
+ - no secret logging
604
+ - no browser bundle usage
605
+ - no business policy decisions
606
+ - no automatic Express middleware in the first version
607
+ - no automatic retries for challenge verification
608
+ - runtime response validation
609
+ - strict TypeScript types
610
+ - minimal runtime surface
558
611
 
559
612
  ---
560
613
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truesift/express",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Server-side TypeScript SDK client for TrueSift human verification API.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -57,4 +57,4 @@
57
57
  "typescript": "^6.0.3",
58
58
  "vitest": "^4.1.9"
59
59
  }
60
- }
60
+ }