blockintel-gate-sdk 0.3.0 → 0.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 +5 -3
- package/dist/index.cjs +552 -66
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +200 -4
- package/dist/index.d.ts +200 -4
- package/dist/index.js +552 -67
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -341,10 +341,11 @@ The SDK includes a **Heartbeat Manager** that automatically acquires and refresh
|
|
|
341
341
|
|
|
342
342
|
### How It Works
|
|
343
343
|
|
|
344
|
-
1. **Automatic Token Acquisition**: The SDK automatically starts a background heartbeat refresher when the `GateClient` is initialized
|
|
345
|
-
2. **Token Refresh**: Heartbeat tokens are refreshed every 10 seconds (configurable) to maintain a valid token
|
|
344
|
+
1. **Automatic Token Acquisition**: The SDK automatically starts a background heartbeat refresher when the `GateClient` is initialized. This continuously sends heartbeats to the Control Plane, keeping the signer status active in the UI.
|
|
345
|
+
2. **Token Refresh**: Heartbeat tokens are refreshed every 10 seconds (configurable via `heartbeatRefreshIntervalSeconds`) to maintain a valid token
|
|
346
346
|
3. **Signing Enforcement**: Before any `evaluate()` call, the SDK checks for a valid heartbeat token. If missing or expired, it throws `HEARTBEAT_MISSING` error
|
|
347
347
|
4. **Token Inclusion**: The heartbeat token is automatically included in the `signingContext` of every evaluation request
|
|
348
|
+
5. **No Manual Scripts Needed**: The SDK handles all heartbeat management automatically - no need for separate heartbeat scripts
|
|
348
349
|
|
|
349
350
|
### Configuration
|
|
350
351
|
|
|
@@ -358,7 +359,8 @@ const gate = new GateClient({
|
|
|
358
359
|
// Heartbeat manager uses baseUrl to infer Control Plane URL
|
|
359
360
|
// Or explicitly set controlPlaneUrl if different
|
|
360
361
|
controlPlaneUrl: 'https://control-plane.blockintelai.net', // Optional
|
|
361
|
-
|
|
362
|
+
signerId: 'my-signer-id', // Optional: signerId for heartbeat (if known upfront)
|
|
363
|
+
heartbeatRefreshIntervalSeconds: 10, // Optional: heartbeat refresh interval (default: 10s)
|
|
362
364
|
});
|
|
363
365
|
```
|
|
364
366
|
|