@nivaro/sdk 0.1.9 → 0.1.10

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/index.d.ts CHANGED
@@ -710,7 +710,7 @@ interface ReportWidgetConfig {
710
710
  filter_field?: string;
711
711
  } | null;
712
712
  }
713
- type ReportWidgetType = 'kpi' | 'kpi_group' | 'bar' | 'line' | 'donut' | 'table' | 'divider' | 'query' | 'queue' | 'calc' | 'movers' | 'heatmap' | 'waterfall' | 'narrative' | 'pareto' | 'stats' | 'scatter' | 'hot_records' | 'metric';
713
+ type ReportWidgetType = 'kpi' | 'kpi_group' | 'bar' | 'line' | 'donut' | 'table' | 'divider' | 'query' | 'queue' | 'calc' | 'movers' | 'heatmap' | 'waterfall' | 'narrative' | 'pareto' | 'stats' | 'scatter' | 'hot_records' | 'metric' | 'pivot' | 'ai_insight';
714
714
  interface ReportWidget {
715
715
  id: UUID;
716
716
  type: ReportWidgetType;
package/dist/index.js CHANGED
@@ -173,6 +173,20 @@ function startSessionRecording(app, origin, clip) {
173
173
  if (app) body.app = app;
174
174
  const resolved = origin ?? (typeof window !== "undefined" ? window.location.origin : void 0);
175
175
  if (resolved) body.origin = resolved;
176
+ if (typeof window !== "undefined" && typeof navigator !== "undefined") {
177
+ try {
178
+ body.meta = {
179
+ user_agent: navigator.userAgent,
180
+ platform: navigator.userAgentData?.platform ?? navigator.platform ?? "",
181
+ screen: `${window.screen?.width ?? 0}x${window.screen?.height ?? 0}`,
182
+ viewport: `${window.innerWidth}x${window.innerHeight}`,
183
+ dpr: window.devicePixelRatio ?? 1,
184
+ language: navigator.language ?? "",
185
+ timezone: Intl.DateTimeFormat().resolvedOptions().timeZone ?? ""
186
+ };
187
+ } catch {
188
+ }
189
+ }
176
190
  if (clip) body.clip = true;
177
191
  return cmd("POST", "/session-recordings/start", void 0, body);
178
192
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nivaro/sdk",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "TypeScript SDK for Nivaro CMS — typed REST client, GraphQL, realtime subscriptions, and presence.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",