@drivemetadata-ai/sdk 0.1.1-beta.2 → 0.1.1-beta.4
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/dist/angular/index.cjs +780 -94
- package/dist/angular/index.cjs.map +1 -1
- package/dist/angular/index.d.cts +2 -2
- package/dist/angular/index.d.ts +2 -2
- package/dist/angular/index.js +780 -94
- package/dist/angular/index.js.map +1 -1
- package/dist/browser/index.cjs +781 -95
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +2 -2
- package/dist/browser/index.d.ts +2 -2
- package/dist/browser/index.js +781 -95
- package/dist/browser/index.js.map +1 -1
- package/dist/next/index.cjs +780 -94
- package/dist/next/index.cjs.map +1 -1
- package/dist/next/index.d.cts +1 -1
- package/dist/next/index.d.ts +1 -1
- package/dist/next/index.js +780 -94
- package/dist/next/index.js.map +1 -1
- package/dist/node/index.cjs +81 -9
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +81 -9
- package/dist/node/index.js.map +1 -1
- package/dist/react/index.cjs +780 -94
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +2 -2
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +780 -94
- package/dist/react/index.js.map +1 -1
- package/dist/{types--V8TVIqT.d.cts → types-mgbdL1V7.d.cts} +17 -4
- package/dist/{types--V8TVIqT.d.ts → types-mgbdL1V7.d.ts} +17 -4
- package/docs/architecture.md +109 -0
- package/docs/index.md +1 -0
- package/docs/integration.md +26 -0
- package/docs/npm-browser-sdk.md +4 -0
- package/package.json +3 -2
package/docs/index.md
CHANGED
package/docs/integration.md
CHANGED
|
@@ -92,6 +92,18 @@ await flush();
|
|
|
92
92
|
console.log(getDmdHealth());
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
+
## Backend Timestamp Fields
|
|
96
|
+
|
|
97
|
+
Every collector request sends these timestamp fields inside `metaData`:
|
|
98
|
+
|
|
99
|
+
| Field | Format | Notes |
|
|
100
|
+
|---|---|---|
|
|
101
|
+
| `timestamp` | `YYYY-MM-DD HH:mm:ss` | UTC, no milliseconds, no timezone suffix |
|
|
102
|
+
| `requestSentAt` | `YYYY-MM-DD HH:mm:ss` | UTC, no milliseconds, no timezone suffix |
|
|
103
|
+
| `requestReceivedAt` | `YYYY-MM-DD HH:mm:ss` | UTC, no milliseconds, no timezone suffix |
|
|
104
|
+
|
|
105
|
+
If a caller provides an invalid timestamp string, the SDK normalizes it to the current UTC time instead of sending the invalid value to the backend.
|
|
106
|
+
|
|
95
107
|
## React Integration
|
|
96
108
|
|
|
97
109
|
Wrap the app once:
|
|
@@ -304,6 +316,20 @@ Common drop reasons:
|
|
|
304
316
|
| `queue_limit_exceeded` | Offline queue is full | Flush more often or increase queue size |
|
|
305
317
|
| `queue_ttl_expired` | Event stayed offline past TTL | Increase TTL only if business requirements allow it |
|
|
306
318
|
|
|
319
|
+
## Backend Payload IDs
|
|
320
|
+
|
|
321
|
+
The SDK sends `requestId`, `anonymousId`, and `sessionId` as UUID strings in `metaData`.
|
|
322
|
+
|
|
323
|
+
```json
|
|
324
|
+
{
|
|
325
|
+
"metaData": {
|
|
326
|
+
"requestId": "019de75e-dd28-779b-8084-2b3091b6de32",
|
|
327
|
+
"anonymousId": "019c8fe4-1fc7-7898-8089-f951a8bbfefb",
|
|
328
|
+
"sessionId": "019de75e-db3f-75e2-8054-0167411aa4ba"
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
```
|
|
332
|
+
|
|
307
333
|
## Production Checklist
|
|
308
334
|
|
|
309
335
|
- Use `@drivemetadata-ai/sdk/browser`, `/react`, `/next`, or `/angular` only for public browser tokens.
|
package/docs/npm-browser-sdk.md
CHANGED
|
@@ -137,3 +137,7 @@ Common drop reasons:
|
|
|
137
137
|
Delivery behavior:
|
|
138
138
|
|
|
139
139
|
The browser SDK adds message IDs and idempotency keys to delivery payloads. Queue diagnostics include expired records, and queue flushing uses a cross-tab lease to avoid duplicate ownership when multiple tabs are open.
|
|
140
|
+
|
|
141
|
+
`metaData.requestId`, `metaData.anonymousId`, and `metaData.sessionId` are UUID strings.
|
|
142
|
+
|
|
143
|
+
`metaData.timestamp`, `metaData.requestSentAt`, and `metaData.requestReceivedAt` use UTC `YYYY-MM-DD HH:mm:ss` format. Invalid timestamp strings are normalized to the current UTC time before sending.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@drivemetadata-ai/sdk",
|
|
3
|
-
"version": "0.1.1-beta.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.1-beta.4",
|
|
4
|
+
"description": "DriveMetaData JavaScript and TypeScript SDK.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"publishConfig": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
12
|
"docs/index.md",
|
|
13
|
+
"docs/architecture.md",
|
|
13
14
|
"docs/integration.md",
|
|
14
15
|
"docs/npm-browser-sdk.md",
|
|
15
16
|
"docs/react-next-integration.md",
|