@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/docs/index.md CHANGED
@@ -13,5 +13,6 @@
13
13
 
14
14
  ## Enterprise Readiness
15
15
 
16
+ - [Architecture](./architecture.md)
16
17
  - [Security and Privacy](./security-privacy.md)
17
18
  - [Release Checklist](./release-checklist.md)
@@ -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.
@@ -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.2",
4
- "description": "Enterprise-grade DriveMetaData browser SDK.",
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",