@sprig-technologies/sprig-browser 2.24.2 → 2.24.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/dist/index.d.ts CHANGED
@@ -263,7 +263,8 @@ declare enum SprigEvent {
263
263
  SurveyWillClose = "survey.willClose",
264
264
  SurveyWillPresent = "survey.will.present",
265
265
  CloseSurveyOnOverlayClick = "close.survey.overlayClick",
266
- VisitorIDUpdated = "visitor.id.updated"
266
+ VisitorIDUpdated = "visitor.id.updated",
267
+ QuestionAnswered = "question.answered"
267
268
  }
268
269
  declare enum SprigEventData {
269
270
  SurveyId = "survey.id"
@@ -279,6 +280,7 @@ declare const EVENTS: {
279
280
  SURVEY_LIFE_CYCLE: SprigEvent;
280
281
  SURVEY_WILL_CLOSE: SprigEvent;
281
282
  SURVEY_WILL_PRESENT: SprigEvent;
283
+ QUESTION_ANSWERED: SprigEvent;
282
284
  CLOSE_SURVEY_ON_OVERLAY_CLICK: SprigEvent;
283
285
  VISITOR_ID_UPDATED: SprigEvent;
284
286
  DATA: {
@@ -726,6 +728,13 @@ declare type SprigEventMap = {
726
728
  [SprigEvent.VisitorIDUpdated]: [{
727
729
  visitorId: string | null;
728
730
  }];
731
+ [SprigEvent.QuestionAnswered]: [
732
+ {
733
+ answeredAt?: number;
734
+ questionIndex?: number;
735
+ value: unknown;
736
+ }
737
+ ];
729
738
  [SprigRecordingEvent.AvPermission]: [
730
739
  {
731
740
  [SprigRecordingEventData.StreamReadyCallback]: (avStream: MediaStream | null, captureStream?: MediaStream | null) => void;
@@ -1086,6 +1095,7 @@ declare namespace sprigConfig {
1086
1095
  height: number | string
1087
1096
  ) => void;
1088
1097
  setEmail: (email: string) => IdentifyResult;
1098
+ setPreviewKey: (previewKey: string) => void;
1089
1099
  setUserId: (userId: string) => IdentifyResult;
1090
1100
  setVisitorEmail: (email: string) => IdentifyResult;
1091
1101
  setVisitorToken: () => void;
@@ -1096,6 +1106,11 @@ declare namespace sprigConfig {
1096
1106
  metadata?: SprigMetadata,
1097
1107
  showSurveyCallback?: (surveyId?: number) => Promise<boolean>
1098
1108
  ) => IdentifyResult;
1109
+ trackPageView: (
1110
+ url: string,
1111
+ properties?: SprigProperties,
1112
+ showSurveyCallback?: (surveyId?: number) => Promise<boolean>
1113
+ ) => void;
1099
1114
  unmute: () => void;
1100
1115
  }
1101
1116
 
@@ -1189,7 +1204,10 @@ declare class SprigAPI {
1189
1204
  SURVEY_LIFE_CYCLE: SprigEvent;
1190
1205
  SURVEY_WILL_CLOSE: SprigEvent;
1191
1206
  SURVEY_WILL_PRESENT: SprigEvent;
1192
- CLOSE_SURVEY_ON_OVERLAY_CLICK: SprigEvent;
1207
+ QUESTION_ANSWERED: SprigEvent;
1208
+ CLOSE_SURVEY_ON_OVERLAY_CLICK: SprigEvent; /**
1209
+ * Attach an email address to visitor
1210
+ */
1193
1211
  VISITOR_ID_UPDATED: SprigEvent;
1194
1212
  DATA: {
1195
1213
  DISMISS_REASONS: {
@@ -1276,6 +1294,10 @@ declare class SprigAPI {
1276
1294
  metadata?: SprigMetadata;
1277
1295
  userId?: string;
1278
1296
  }): void;
1297
+ /**
1298
+ * Tracks a page view with the provided URL and additional event properties.
1299
+ */
1300
+ trackPageView(url: string, props?: SprigProperties, showSurveyCallback?: (surveyId?: number) => Promise<boolean>): void;
1279
1301
  /**
1280
1302
  * Apply a css string representing the customized styles
1281
1303
  */