@primestyleai/tryon 5.10.193 → 5.10.195

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.
@@ -11,6 +11,7 @@ export declare class PrimeStyleTryon extends HTMLElement {
11
11
  private errorMessage;
12
12
  private currentJobId;
13
13
  private productImageUrl;
14
+ private productViewReportedFor;
14
15
  private t;
15
16
  private buttonStyles;
16
17
  private modalStyles;
@@ -36,6 +37,10 @@ export declare class PrimeStyleTryon extends HTMLElement {
36
37
  private initApi;
37
38
  private cleanup;
38
39
  private emit;
40
+ private get eventProductContext();
41
+ private reportProductView;
42
+ private reportEvent;
43
+ private reportClientError;
39
44
  private get buttonText();
40
45
  private get showPoweredBy();
41
46
  private render;
@@ -58,6 +58,29 @@ export interface TryOnFeedbackInput {
58
58
  profileName?: string;
59
59
  profileAccessToken?: string;
60
60
  }
61
+ export type SdkBehaviorEventType = "PRODUCT_VIEW" | "SDK_OPENED" | "PHOTO_UPLOADED" | "SIZING_STARTED" | "SIZING_FAILED" | "SIZE_RECOMMENDATION_SHOWN" | "SIZE_RECOMMENDATION_ACCEPTED" | "ADD_TO_CART_FROM_TRYON" | "SDK_CLIENT_ERROR";
62
+ export interface SdkBehaviorEventInput {
63
+ eventType: SdkBehaviorEventType;
64
+ productId?: string;
65
+ productTitle?: string;
66
+ productUrl?: string;
67
+ jobId?: string;
68
+ recommendedSize?: string;
69
+ metadata?: Record<string, unknown>;
70
+ }
71
+ export interface SdkClientErrorInput {
72
+ message: string;
73
+ code?: string;
74
+ stack?: string;
75
+ component?: string;
76
+ view?: string;
77
+ severity?: "low" | "medium" | "high" | "critical";
78
+ productId?: string;
79
+ productTitle?: string;
80
+ productUrl?: string;
81
+ jobId?: string;
82
+ metadata?: Record<string, unknown>;
83
+ }
61
84
  export declare class ApiClient {
62
85
  private apiKey?;
63
86
  private baseUrl;
@@ -68,7 +91,13 @@ export declare class ApiClient {
68
91
  submitTryOnFeedback(input: TryOnFeedbackInput): Promise<{
69
92
  ok: true;
70
93
  }>;
71
- getStreamUrl(): string;
94
+ reportEvent(input: SdkBehaviorEventInput): Promise<{
95
+ ok: true;
96
+ }>;
97
+ reportClientError(input: SdkClientErrorInput): Promise<{
98
+ ok: true;
99
+ }>;
100
+ getStreamUrl(jobId?: string): string;
72
101
  }
73
102
  export declare function jsonHeaders(apiKey?: string): Record<string, string>;
74
103
  export declare class PrimeStyleError extends Error {