@usermaven/sdk-js 1.0.8 → 1.1.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.
@@ -59,6 +59,16 @@ export type UsermavenClient = {
59
59
  * User
60
60
  */
61
61
  unset(propertyName: string, opts: { eventType?: string, persist?: boolean });
62
+
63
+ /**
64
+ * Trigger for auto-captured event.
65
+ * @param name event name
66
+ * @param payload event payload
67
+ * @return Promise, see _send3p documentation
68
+ */
69
+ capture?: (name: string, properties?: EventPayload, opts?: UsermavenOptions) => void
70
+
71
+
62
72
  }
63
73
 
64
74
  /**
@@ -205,32 +215,27 @@ export type UsermavenOptions = {
205
215
  custom_headers?: Record<string, string> | (() => Record<string, string>)
206
216
 
207
217
  /**
208
- * Type of persistence required
209
- * Possible values: cookie | localStorage | localStorage+cookie | memory
210
- *
211
- * @default cookie
218
+ * Minimum timeout before re-attempting to send events.
219
+ * Defaults to 0.
212
220
  */
213
- persistence?: PersistenceType;
221
+ min_send_timeout?: number
214
222
 
215
223
  /**
216
- * Persistent connection name
224
+ * Maximum timeout before re-attempting to send events.
225
+ * Defaults to 2 seconds.
217
226
  */
218
- persistence_name?: string;
227
+ max_send_timeout?: number
219
228
 
220
229
  /**
221
- * Session tracking time in seconds (x)
222
- * After x seconds of inactivity, new session will be created. Default time is 30 minutes i.e 1800 seconds
223
- *
224
- * @default 1800
230
+ * Maximum number of send event attempts.
231
+ * Defaults to 4.
225
232
  */
226
- persistence_time?: number;
233
+ max_send_attempts?: number
227
234
 
228
235
  /**
229
- * Disable session tracking here
230
- *
231
- * @default false
236
+ * Whether failed events should NOT be persisted when applicable.
232
237
  */
233
- disable_persistence?: boolean;
238
+ disable_event_persistence?: boolean
234
239
 
235
240
  /**
236
241
  * Auto-capturing is disabled by default
@@ -239,13 +244,6 @@ export type UsermavenOptions = {
239
244
  */
240
245
  autocapture?: boolean,
241
246
 
242
- /**
243
- * Should a page_view event be triggered on page load
244
- *
245
- * @default true
246
- */
247
- capture_pageview?: boolean,
248
-
249
247
  /**
250
248
  * To control the payload properties character limit. Defaults to null that means there is no limit. i.e 65535
251
249
  *
@@ -265,14 +263,21 @@ export type UsermavenOptions = {
265
263
  */
266
264
  project_id?: string;
267
265
 
268
- /**
269
- * Enable cookie across subdomain
270
- * Default value: true
271
- */
272
- cross_subdomain_cookie?: boolean;
273
266
 
274
267
  //NOTE: If any property is added here, please make sure it's added to browser.ts usermavenProps as well
275
268
 
269
+ /**
270
+ * Mask all element attributes
271
+ */
272
+ mask_all_element_attributes?: boolean
273
+
274
+ /**
275
+ * Mask all text
276
+ */
277
+ mask_all_text?: boolean
278
+
279
+
280
+
276
281
  };
277
282
 
278
283
  /**
@@ -468,3 +473,42 @@ export type EventCompat = EventBasics & {
468
473
  } & EventPayload;
469
474
 
470
475
  export type PersistenceType = 'cookie' | 'localStorage' | 'localStorage+cookie' | 'memory';
476
+
477
+ // Autocapture
478
+ export type Property = any
479
+ export type Properties = Record<string, Property>
480
+
481
+ export enum Compression {
482
+ GZipJS = 'gzip-js',
483
+ LZ64 = 'lz64',
484
+ Base64 = 'base64',
485
+ }
486
+
487
+ export interface EditorParams {
488
+ jsURL?: string
489
+ apiURL?: string
490
+ toolbarVersion?: 'toolbar'
491
+ }
492
+
493
+
494
+ export interface DecideResponse {
495
+ status: number
496
+ supportedCompression: Compression[]
497
+ config: {
498
+ enable_collect_everything: boolean
499
+ }
500
+ custom_properties: AutoCaptureCustomProperty[] // TODO: delete, not sent
501
+ featureFlags: Record<string, string | boolean>
502
+ sessionRecording?: {
503
+ endpoint?: string
504
+ }
505
+ editorParams: EditorParams
506
+ toolbarVersion: 'toolbar' /** deprecated, moved to editorParams */
507
+ isAuthenticated: boolean
508
+ }
509
+
510
+ export interface AutoCaptureCustomProperty {
511
+ name: string
512
+ css_selector: string
513
+ event_selectors: string[]
514
+ }