@primestyleai/tryon 5.10.194 → 5.10.196

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,11 @@ 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 tagClarity;
43
+ private reportEvent;
44
+ private reportClientError;
39
45
  private get buttonText();
40
46
  private get showPoweredBy();
41
47
  private render;
@@ -58,6 +58,38 @@ 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
+ }
84
+ export interface SdkReplayChunkInput {
85
+ sessionId: string;
86
+ sequence: number;
87
+ events: unknown[];
88
+ productId?: string;
89
+ productTitle?: string;
90
+ productUrl?: string;
91
+ deviceHint?: string | null;
92
+ }
61
93
  export declare class ApiClient {
62
94
  private apiKey?;
63
95
  private baseUrl;
@@ -68,7 +100,16 @@ export declare class ApiClient {
68
100
  submitTryOnFeedback(input: TryOnFeedbackInput): Promise<{
69
101
  ok: true;
70
102
  }>;
71
- getStreamUrl(): string;
103
+ reportEvent(input: SdkBehaviorEventInput): Promise<{
104
+ ok: true;
105
+ }>;
106
+ reportClientError(input: SdkClientErrorInput): Promise<{
107
+ ok: true;
108
+ }>;
109
+ reportReplayChunk(input: SdkReplayChunkInput): Promise<{
110
+ ok: true;
111
+ }>;
112
+ getStreamUrl(jobId?: string): string;
72
113
  }
73
114
  export declare function jsonHeaders(apiKey?: string): Record<string, string>;
74
115
  export declare class PrimeStyleError extends Error {
@@ -0,0 +1,13 @@
1
+ interface SdkClarityContext {
2
+ projectId?: string | null;
3
+ productId?: string | null;
4
+ productTitle?: string | null;
5
+ productUrl?: string | null;
6
+ view?: string | null;
7
+ jobId?: string | null;
8
+ source?: string | null;
9
+ }
10
+ export declare function resolveSdkClarityProjectId(projectId?: string | null): string | null;
11
+ export declare function tagSdkClaritySession(input?: SdkClarityContext): void;
12
+ export declare function startSdkClarity(input?: SdkClarityContext): boolean;
13
+ export {};