ai-publish-sdk 1.7.0 → 1.7.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 +22 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -116,6 +116,28 @@ Emit structured analytics events from your app. The host auto-populates `timesta
116
116
 
117
117
  ```typescript
118
118
  trackEvent(params: TrackEventParams): Promise<void>
119
+
120
+ interface TrackEventParams {
121
+ eventName: SnakeCase<string> // required — snake_case identifier (e.g. 'quiz_completed')
122
+ additionalDetails?: TrackEventDetails // optional — primitive-valued bag, one level of nesting allowed
123
+ }
124
+
125
+ type TrackEventDetailValue = string | number | boolean | null
126
+
127
+ type TrackEventDetails = Record<
128
+ string,
129
+ TrackEventDetailValue | Record<string, TrackEventDetailValue>
130
+ >
131
+ ```
132
+
133
+ Only `eventName` is required. Example:
134
+
135
+ ```typescript
136
+ await trackEvent({ eventName: 'quiz_completed' })
137
+ await trackEvent({
138
+ eventName: 'quiz_completed',
139
+ additionalDetails: { score: 8, total: 10, module: 'phishing' },
140
+ })
119
141
  ```
120
142
 
121
143
  ## Device API
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-publish-sdk",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "module": "./index.mjs",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",