@segment/analytics-browser-mixpanel-web-actions 1.0.1-staging-294d81392.0

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.
Files changed (135) hide show
  1. package/README.md +31 -0
  2. package/dist/cjs/alias/generated-types.d.ts +4 -0
  3. package/dist/cjs/alias/generated-types.js +3 -0
  4. package/dist/cjs/alias/generated-types.js.map +1 -0
  5. package/dist/cjs/alias/index.d.ts +6 -0
  6. package/dist/cjs/alias/index.js +32 -0
  7. package/dist/cjs/alias/index.js.map +1 -0
  8. package/dist/cjs/constants.d.ts +14 -0
  9. package/dist/cjs/constants.js +18 -0
  10. package/dist/cjs/constants.js.map +1 -0
  11. package/dist/cjs/fields.d.ts +11 -0
  12. package/dist/cjs/fields.js +162 -0
  13. package/dist/cjs/fields.js.map +1 -0
  14. package/dist/cjs/functions.d.ts +7 -0
  15. package/dist/cjs/functions.js +39 -0
  16. package/dist/cjs/functions.js.map +1 -0
  17. package/dist/cjs/generated-types.d.ts +30 -0
  18. package/dist/cjs/generated-types.js +3 -0
  19. package/dist/cjs/generated-types.js.map +1 -0
  20. package/dist/cjs/group/generated-types.d.ts +16 -0
  21. package/dist/cjs/group/generated-types.js +3 -0
  22. package/dist/cjs/group/generated-types.js.map +1 -0
  23. package/dist/cjs/group/index.d.ts +6 -0
  24. package/dist/cjs/group/index.js +21 -0
  25. package/dist/cjs/group/index.js.map +1 -0
  26. package/dist/cjs/identify/generated-types.d.ts +19 -0
  27. package/dist/cjs/identify/generated-types.js +3 -0
  28. package/dist/cjs/identify/generated-types.js.map +1 -0
  29. package/dist/cjs/identify/index.d.ts +6 -0
  30. package/dist/cjs/identify/index.js +21 -0
  31. package/dist/cjs/identify/index.js.map +1 -0
  32. package/dist/cjs/index.d.ts +11 -0
  33. package/dist/cjs/index.js +76 -0
  34. package/dist/cjs/index.js.map +1 -0
  35. package/dist/cjs/init-script.d.ts +1 -0
  36. package/dist/cjs/init-script.js +65 -0
  37. package/dist/cjs/init-script.js.map +1 -0
  38. package/dist/cjs/setting-fields.d.ts +2 -0
  39. package/dist/cjs/setting-fields.js +273 -0
  40. package/dist/cjs/setting-fields.js.map +1 -0
  41. package/dist/cjs/track/generated-types.d.ts +37 -0
  42. package/dist/cjs/track/generated-types.js +3 -0
  43. package/dist/cjs/track/generated-types.js.map +1 -0
  44. package/dist/cjs/track/index.d.ts +6 -0
  45. package/dist/cjs/track/index.js +93 -0
  46. package/dist/cjs/track/index.js.map +1 -0
  47. package/dist/cjs/trackPageView/generated-types.d.ts +37 -0
  48. package/dist/cjs/trackPageView/generated-types.js +3 -0
  49. package/dist/cjs/trackPageView/generated-types.js.map +1 -0
  50. package/dist/cjs/trackPageView/index.d.ts +6 -0
  51. package/dist/cjs/trackPageView/index.js +101 -0
  52. package/dist/cjs/trackPageView/index.js.map +1 -0
  53. package/dist/cjs/types.d.ts +68 -0
  54. package/dist/cjs/types.js +3 -0
  55. package/dist/cjs/types.js.map +1 -0
  56. package/dist/esm/alias/generated-types.d.ts +4 -0
  57. package/dist/esm/alias/generated-types.js +2 -0
  58. package/dist/esm/alias/generated-types.js.map +1 -0
  59. package/dist/esm/alias/index.d.ts +6 -0
  60. package/dist/esm/alias/index.js +30 -0
  61. package/dist/esm/alias/index.js.map +1 -0
  62. package/dist/esm/constants.d.ts +14 -0
  63. package/dist/esm/constants.js +15 -0
  64. package/dist/esm/constants.js.map +1 -0
  65. package/dist/esm/fields.d.ts +11 -0
  66. package/dist/esm/fields.js +159 -0
  67. package/dist/esm/fields.js.map +1 -0
  68. package/dist/esm/functions.d.ts +7 -0
  69. package/dist/esm/functions.js +35 -0
  70. package/dist/esm/functions.js.map +1 -0
  71. package/dist/esm/generated-types.d.ts +30 -0
  72. package/dist/esm/generated-types.js +2 -0
  73. package/dist/esm/generated-types.js.map +1 -0
  74. package/dist/esm/group/generated-types.d.ts +16 -0
  75. package/dist/esm/group/generated-types.js +2 -0
  76. package/dist/esm/group/generated-types.js.map +1 -0
  77. package/dist/esm/group/index.d.ts +6 -0
  78. package/dist/esm/group/index.js +19 -0
  79. package/dist/esm/group/index.js.map +1 -0
  80. package/dist/esm/identify/generated-types.d.ts +19 -0
  81. package/dist/esm/identify/generated-types.js +2 -0
  82. package/dist/esm/identify/generated-types.js.map +1 -0
  83. package/dist/esm/identify/index.d.ts +6 -0
  84. package/dist/esm/identify/index.js +19 -0
  85. package/dist/esm/identify/index.js.map +1 -0
  86. package/dist/esm/index.d.ts +11 -0
  87. package/dist/esm/index.js +72 -0
  88. package/dist/esm/index.js.map +1 -0
  89. package/dist/esm/init-script.d.ts +1 -0
  90. package/dist/esm/init-script.js +62 -0
  91. package/dist/esm/init-script.js.map +1 -0
  92. package/dist/esm/setting-fields.d.ts +2 -0
  93. package/dist/esm/setting-fields.js +270 -0
  94. package/dist/esm/setting-fields.js.map +1 -0
  95. package/dist/esm/track/generated-types.d.ts +37 -0
  96. package/dist/esm/track/generated-types.js +2 -0
  97. package/dist/esm/track/generated-types.js.map +1 -0
  98. package/dist/esm/track/index.d.ts +6 -0
  99. package/dist/esm/track/index.js +91 -0
  100. package/dist/esm/track/index.js.map +1 -0
  101. package/dist/esm/trackPageView/generated-types.d.ts +37 -0
  102. package/dist/esm/trackPageView/generated-types.js +2 -0
  103. package/dist/esm/trackPageView/generated-types.js.map +1 -0
  104. package/dist/esm/trackPageView/index.d.ts +6 -0
  105. package/dist/esm/trackPageView/index.js +99 -0
  106. package/dist/esm/trackPageView/index.js.map +1 -0
  107. package/dist/esm/types.d.ts +68 -0
  108. package/dist/esm/types.js +2 -0
  109. package/dist/esm/types.js.map +1 -0
  110. package/dist/tsconfig.tsbuildinfo +1 -0
  111. package/package.json +25 -0
  112. package/src/alias/__tests__/index.test.ts +95 -0
  113. package/src/alias/generated-types.ts +12 -0
  114. package/src/alias/index.ts +35 -0
  115. package/src/constants.ts +16 -0
  116. package/src/fields.ts +173 -0
  117. package/src/functions.ts +57 -0
  118. package/src/generated-types.ts +116 -0
  119. package/src/group/__tests__/index.test.ts +126 -0
  120. package/src/group/generated-types.ts +42 -0
  121. package/src/group/index.ts +29 -0
  122. package/src/identify/__tests__/index.test.ts +135 -0
  123. package/src/identify/generated-types.ts +54 -0
  124. package/src/identify/index.ts +29 -0
  125. package/src/index.ts +99 -0
  126. package/src/init-script.ts +63 -0
  127. package/src/setting-fields.ts +273 -0
  128. package/src/track/__tests__/index.test.ts +196 -0
  129. package/src/track/generated-types.ts +102 -0
  130. package/src/track/index.ts +109 -0
  131. package/src/trackPageView/__tests__/index.test.ts +250 -0
  132. package/src/trackPageView/generated-types.ts +102 -0
  133. package/src/trackPageView/index.ts +116 -0
  134. package/src/types.ts +78 -0
  135. package/tsconfig.json +9 -0
@@ -0,0 +1,54 @@
1
+ // Generated file. DO NOT MODIFY IT BY HAND.
2
+
3
+ export interface Payload {
4
+ /**
5
+ * The unique ID to associate with the user.
6
+ */
7
+ unique_id: string
8
+ /**
9
+ * User Profile Properties to set on the user profile in Mixpanel.
10
+ */
11
+ user_profile_properties_to_set?: {
12
+ /**
13
+ * The name of the user.
14
+ */
15
+ name?: string
16
+ /**
17
+ * The first name of the user.
18
+ */
19
+ first_name?: string
20
+ /**
21
+ * The last name of the user.
22
+ */
23
+ last_name?: string
24
+ /**
25
+ * The email of the user.
26
+ */
27
+ email?: string
28
+ /**
29
+ * The phone number of the user.
30
+ */
31
+ phone?: string
32
+ /**
33
+ * The avatar URL of the user.
34
+ */
35
+ avatar?: string
36
+ /**
37
+ * The creation date of the user profile.
38
+ */
39
+ created?: string
40
+ [k: string]: unknown
41
+ }
42
+ /**
43
+ * User Profile Properties to set once on the user profile in Mixpanel. Values which get set once cannot be overwritten later.
44
+ */
45
+ user_profile_properties_to_set_once?: {
46
+ [k: string]: unknown
47
+ }
48
+ /**
49
+ * User Profile Properties to increment on the user profile in Mixpanel. Values must be numeric.
50
+ */
51
+ user_profile_properties_to_increment?: {
52
+ [k: string]: unknown
53
+ }
54
+ }
@@ -0,0 +1,29 @@
1
+ import type { BrowserActionDefinition } from '@segment/browser-destination-runtime/types'
2
+ import type { Settings } from '../generated-types'
3
+ import type { Payload } from './generated-types'
4
+ import type { Mixpanel } from '../types'
5
+ import { sendIdentify } from '../functions'
6
+ import {
7
+ unique_id,
8
+ user_profile_properties_to_set,
9
+ user_profile_properties_to_set_once,
10
+ user_profile_properties_to_increment
11
+ } from '../fields'
12
+
13
+ const action: BrowserActionDefinition<Settings, Mixpanel, Payload> = {
14
+ title: 'Identify',
15
+ description: 'Sync user profile data to Mixpanel.',
16
+ defaultSubscription: 'type = "identify"',
17
+ platform: 'web',
18
+ fields: {
19
+ unique_id,
20
+ user_profile_properties_to_set,
21
+ user_profile_properties_to_set_once,
22
+ user_profile_properties_to_increment
23
+ },
24
+ perform: (mixpanel, { payload }) => {
25
+ sendIdentify(mixpanel, payload)
26
+ }
27
+ }
28
+
29
+ export default action
package/src/index.ts ADDED
@@ -0,0 +1,99 @@
1
+ import type { Settings } from './generated-types'
2
+ import type { BrowserDestinationDefinition } from '@segment/browser-destination-runtime/types'
3
+ import { browserDestination } from '@segment/browser-destination-runtime/shim'
4
+ import type { Mixpanel, PageViewUrlConfigOption, PersistenceOptions, Config } from './types'
5
+ import { defaultValues } from '@segment/actions-core'
6
+ import { AUTOCAPTURE_OPTIONS } from './constants'
7
+ import { settingFields } from './setting-fields'
8
+ import track from './track'
9
+ import trackPageView from './trackPageView'
10
+ import identify from './identify'
11
+ import group from './group'
12
+ import alias from './alias'
13
+ import { initScript } from './init-script'
14
+ declare global {
15
+ interface Window {
16
+ mixpanel: Mixpanel
17
+ }
18
+ }
19
+
20
+ // Switch from unknown to the partner SDK client types
21
+ export const destination: BrowserDestinationDefinition<Settings, Mixpanel> = {
22
+ name: 'Mixpanel Web (actions)',
23
+ slug: 'mixpanel-web-actions',
24
+ mode: 'device',
25
+ settings: settingFields,
26
+ initialize: async ({ settings }, deps) => {
27
+ await initScript()
28
+ await deps.resolveWhen(() => window?.mixpanel != null, 100)
29
+ const mixpanel = window.mixpanel
30
+
31
+ const {
32
+ projectToken,
33
+ name,
34
+ autocapture,
35
+ pageview,
36
+ click,
37
+ dead_click,
38
+ input,
39
+ rage_click,
40
+ scroll,
41
+ submit,
42
+ capture_text_content,
43
+ persistence,
44
+ ...rest
45
+ } = settings
46
+
47
+ const config: Config = {
48
+ autocapture:
49
+ autocapture === AUTOCAPTURE_OPTIONS.CUSTOM
50
+ ? {
51
+ pageview: pageview as PageViewUrlConfigOption,
52
+ click,
53
+ dead_click,
54
+ input,
55
+ rage_click,
56
+ scroll,
57
+ submit,
58
+ capture_text_content
59
+ }
60
+ : autocapture === AUTOCAPTURE_OPTIONS.ENABLED
61
+ ? true
62
+ : false,
63
+ persistence: persistence as PersistenceOptions,
64
+ ...rest
65
+ }
66
+
67
+ if (name) {
68
+ mixpanel.init(projectToken, config, name)
69
+ } else {
70
+ mixpanel.init(projectToken, config)
71
+ }
72
+ return mixpanel
73
+ },
74
+ presets: [
75
+ {
76
+ name: 'Track',
77
+ subscribe: 'type = "track"',
78
+ partnerAction: 'track',
79
+ mapping: defaultValues(track.fields),
80
+ type: 'automatic'
81
+ },
82
+ {
83
+ name: 'Identify',
84
+ subscribe: 'type = "identify"',
85
+ partnerAction: 'identify',
86
+ mapping: defaultValues(identify.fields),
87
+ type: 'automatic'
88
+ }
89
+ ],
90
+ actions: {
91
+ track,
92
+ trackPageView,
93
+ identify,
94
+ group,
95
+ alias
96
+ }
97
+ }
98
+
99
+ export default browserDestination(destination)
@@ -0,0 +1,63 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ export async function initScript() {
4
+ ;(function (f, b) {
5
+ if (!b.__SV) {
6
+ var e, g, i, h
7
+ window.mixpanel = b
8
+ b._i = []
9
+ b.init = function (e, f, c) {
10
+ function g(a, d) {
11
+ var b = d.split('.')
12
+ 2 == b.length && ((a = a[b[0]]), (d = b[1]))
13
+ a[d] = function () {
14
+ a.push([d].concat(Array.prototype.slice.call(arguments, 0)))
15
+ }
16
+ }
17
+ var a = b
18
+ 'undefined' !== typeof c ? (a = b[c] = []) : (c = 'mixpanel')
19
+ a.people = a.people || []
20
+ a.toString = function (a) {
21
+ var d = 'mixpanel'
22
+ 'mixpanel' !== c && (d += '.' + c)
23
+ a || (d += ' (stub)')
24
+ return d
25
+ }
26
+ a.people.toString = function () {
27
+ return a.toString(1) + '.people (stub)'
28
+ }
29
+ i =
30
+ 'disable time_event track track_pageview track_links track_forms track_with_groups add_group set_group remove_group register register_once alias unregister identify name_tag set_config reset opt_in_tracking opt_out_tracking has_opted_in_tracking has_opted_out_tracking clear_opt_in_out_tracking start_batch_senders people.set people.set_once people.unset people.increment people.append people.union people.track_charge people.clear_charges people.delete_user people.remove'.split(
31
+ ' '
32
+ )
33
+ for (h = 0; h < i.length; h++) g(a, i[h])
34
+ var j = 'set set_once union unset remove delete'.split(' ')
35
+ a.get_group = function () {
36
+ function b(c) {
37
+ d[c] = function () {
38
+ call2_args = arguments
39
+ call2 = [c].concat(Array.prototype.slice.call(call2_args, 0))
40
+ a.push([e, call2])
41
+ }
42
+ }
43
+ for (var d = {}, e = ['get_group'].concat(Array.prototype.slice.call(arguments, 0)), c = 0; c < j.length; c++)
44
+ b(j[c])
45
+ return d
46
+ }
47
+ b._i.push([e, f, c])
48
+ }
49
+ b.__SV = 1.2
50
+ e = f.createElement('script')
51
+ e.type = 'text/javascript'
52
+ e.async = !0
53
+ e.src =
54
+ 'undefined' !== typeof MIXPANEL_CUSTOM_LIB_URL
55
+ ? MIXPANEL_CUSTOM_LIB_URL
56
+ : 'file:' === f.location.protocol && '//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js'.match(/^\/\//)
57
+ ? 'https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js'
58
+ : '//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js'
59
+ g = f.getElementsByTagName('script')[0]
60
+ g.parentNode.insertBefore(e, g)
61
+ }
62
+ })(document, window.mixpanel || [])
63
+ }
@@ -0,0 +1,273 @@
1
+ import { PAGE_VIEW_URL_CONFIG_OPTIONS, PERSISTENCE_OPTIONS, AUTOCAPTURE_OPTIONS } from './constants'
2
+ import { GlobalSetting } from '@segment/actions-core'
3
+
4
+ export const settingFields: Record<string, GlobalSetting> = {
5
+ projectToken: {
6
+ description: 'Your Mixpanel project token.',
7
+ label: 'Project Token',
8
+ type: 'string',
9
+ required: true
10
+ },
11
+ name: {
12
+ label: 'Mixpanel Instance Name',
13
+ description: 'The name for the new mixpanel instance that you want created.',
14
+ type: 'string'
15
+ },
16
+ api_host: {
17
+ description: 'The Mixpanel API host to send data to.',
18
+ label: 'API Host',
19
+ type: 'string',
20
+ format: 'uri',
21
+ required: true,
22
+ default: 'https://api-js.mixpanel.com'
23
+ },
24
+ autocapture: {
25
+ description:
26
+ 'Enable or disable Mixpanel autocapture functionality. Select "Custom" to specify fine grained control over which events are autocaptured.',
27
+ label: 'Autocapture',
28
+ type: 'string',
29
+ choices: [
30
+ { label: 'Enabled', value: AUTOCAPTURE_OPTIONS.ENABLED },
31
+ { label: 'Disabled', value: AUTOCAPTURE_OPTIONS.DISABLED },
32
+ { label: 'Custom', value: AUTOCAPTURE_OPTIONS.CUSTOM }
33
+ ],
34
+ default: AUTOCAPTURE_OPTIONS.ENABLED
35
+ },
36
+ pageview: {
37
+ description: 'Capture pageview events automatically',
38
+ label: 'Autocapture Pageview',
39
+ type: 'string',
40
+ choices: [
41
+ { label: 'Full URL', value: PAGE_VIEW_URL_CONFIG_OPTIONS.FULL_URL },
42
+ { label: 'URL with Path and Query String', value: PAGE_VIEW_URL_CONFIG_OPTIONS.URL_WITH_PATH_AND_QUERY_STRING },
43
+ { label: 'URL with Path', value: PAGE_VIEW_URL_CONFIG_OPTIONS.URL_WITH_PATH }
44
+ ],
45
+ default: PAGE_VIEW_URL_CONFIG_OPTIONS.FULL_URL,
46
+ required: true,
47
+ depends_on: {
48
+ conditions: [
49
+ {
50
+ fieldKey: 'autocapture',
51
+ operator: 'is',
52
+ value: 'custom'
53
+ }
54
+ ]
55
+ }
56
+ },
57
+ click: {
58
+ description: 'Capture click events automatically',
59
+ label: 'Autocapture Click',
60
+ type: 'boolean',
61
+ default: true,
62
+ required: true,
63
+ depends_on: {
64
+ conditions: [
65
+ {
66
+ fieldKey: 'autocapture',
67
+ operator: 'is',
68
+ value: 'custom'
69
+ }
70
+ ]
71
+ }
72
+ },
73
+ dead_click: {
74
+ description: 'Capture dead click events automatically',
75
+ label: 'Autocapture Dead Click',
76
+ type: 'boolean',
77
+ default: true,
78
+ required: true,
79
+ depends_on: {
80
+ conditions: [
81
+ {
82
+ fieldKey: 'autocapture',
83
+ operator: 'is',
84
+ value: 'custom'
85
+ }
86
+ ]
87
+ }
88
+ },
89
+ input: {
90
+ description: 'Capture input events automatically',
91
+ label: 'Autocapture Input',
92
+ type: 'boolean',
93
+ default: true,
94
+ required: true,
95
+ depends_on: {
96
+ conditions: [
97
+ {
98
+ fieldKey: 'autocapture',
99
+ operator: 'is',
100
+ value: 'custom'
101
+ }
102
+ ]
103
+ }
104
+ },
105
+ rage_click: {
106
+ description: 'Capture rage click events automatically',
107
+ label: 'Autocapture Rage Click',
108
+ type: 'boolean',
109
+ default: true,
110
+ required: true,
111
+ depends_on: {
112
+ conditions: [
113
+ {
114
+ fieldKey: 'autocapture',
115
+ operator: 'is',
116
+ value: 'custom'
117
+ }
118
+ ]
119
+ }
120
+ },
121
+ scroll: {
122
+ description: 'Capture scroll events automatically',
123
+ label: 'Autocapture Scroll',
124
+ type: 'boolean',
125
+ default: true,
126
+ required: true,
127
+ depends_on: {
128
+ conditions: [
129
+ {
130
+ fieldKey: 'autocapture',
131
+ operator: 'is',
132
+ value: 'custom'
133
+ }
134
+ ]
135
+ }
136
+ },
137
+ submit: {
138
+ description: 'Capture form submit events automatically',
139
+ label: 'Autocapture Submit',
140
+ type: 'boolean',
141
+ default: true,
142
+ depends_on: {
143
+ conditions: [
144
+ {
145
+ fieldKey: 'autocapture',
146
+ operator: 'is',
147
+ value: 'custom'
148
+ }
149
+ ]
150
+ }
151
+ },
152
+ capture_text_content: {
153
+ description: 'Capture text content of elements in autocaptured events',
154
+ label: 'Autocapture Capture Text Content',
155
+ type: 'boolean',
156
+ default: false,
157
+ required: true,
158
+ depends_on: {
159
+ conditions: [
160
+ {
161
+ fieldKey: 'autocapture',
162
+ operator: 'is',
163
+ value: 'custom'
164
+ }
165
+ ]
166
+ }
167
+ },
168
+ cross_subdomain_cookie: {
169
+ description: 'Enable or disable cross subdomain cookies for Mixpanel.',
170
+ label: 'Cross Subdomain Cookie',
171
+ type: 'boolean',
172
+ default: true
173
+ },
174
+ persistence: {
175
+ description: 'Set the persistence method for Mixpanel (cookie or localStorage).',
176
+ label: 'Persistence Method',
177
+ type: 'string',
178
+ choices: [
179
+ { label: 'Cookie', value: PERSISTENCE_OPTIONS.COOKIE },
180
+ { label: 'Local Storage', value: PERSISTENCE_OPTIONS.LOCAL_STORAGE }
181
+ ],
182
+ default: PERSISTENCE_OPTIONS.COOKIE
183
+ },
184
+ track_marketing: {
185
+ description:
186
+ 'Enable or disable tracking of marketing campaigns in Mixpanel. Includes UTM parameters and click identifiers for various ad platforms.',
187
+ label: 'Track Marketing Campaigns',
188
+ type: 'boolean',
189
+ default: true
190
+ },
191
+ cookie_expiration: {
192
+ description: 'Set the cookie expiration time in days for Mixpanel cookies.',
193
+ label: 'Cookie Expiration (days)',
194
+ type: 'number',
195
+ default: 365
196
+ },
197
+ disable_persistence: {
198
+ description: 'Disable all persistence mechanisms for Mixpanel.',
199
+ label: 'Disable Persistence',
200
+ type: 'boolean',
201
+ default: false
202
+ },
203
+ ip: {
204
+ description: 'Enable or disable sending IP address information to Mixpanel.',
205
+ label: 'Send IP Address',
206
+ type: 'boolean',
207
+ default: true
208
+ },
209
+ record_block_class: {
210
+ description: 'CSS class to block elements from being recorded in session recordings.',
211
+ label: 'Record Block Class',
212
+ type: 'string',
213
+ default: 'mp-block'
214
+ },
215
+ record_block_selector: {
216
+ description: 'CSS selector to block elements from being recorded in session recordings.',
217
+ label: 'Record Block Selector',
218
+ type: 'string',
219
+ default: 'img, video, audio'
220
+ },
221
+ record_canvas: {
222
+ description: 'Enable or disable recording of canvas elements in session recordings.',
223
+ label: 'Record Canvas',
224
+ type: 'boolean',
225
+ default: false
226
+ },
227
+ record_heatmap_data: {
228
+ description: 'Enable or disable tracking of heatmap events in session recordings.',
229
+ label: 'Record Heatmap Data',
230
+ type: 'boolean',
231
+ default: false
232
+ },
233
+ record_idle_timeout_ms: {
234
+ description: 'Idle timeout in milliseconds for session recordings.',
235
+ label: 'Record Idle Timeout (ms)',
236
+ type: 'number',
237
+ default: 180_000
238
+ },
239
+ record_mask_text_class: {
240
+ description: 'CSS class to mask text elements in session recordings.',
241
+ label: 'Record Mask Text Class',
242
+ type: 'string',
243
+ default: 'mp-mask'
244
+ },
245
+ record_mask_text_selector: {
246
+ description: 'CSS selector to mask text elements in session recordings.',
247
+ label: 'Record Mask Text Selector',
248
+ type: 'string',
249
+ default: '*'
250
+ },
251
+ record_max_ms: {
252
+ description: 'Maximum recording time in milliseconds for session recordings.',
253
+ label: 'Record Max (ms)',
254
+ type: 'number',
255
+ default: 86_400_000
256
+ },
257
+ record_min_ms: {
258
+ description: 'Minimum recording time in milliseconds for session recordings.',
259
+ label: 'Record Min (ms)',
260
+ type: 'number',
261
+ default: 0,
262
+ minimum: 0,
263
+ maximum: 8_000
264
+ },
265
+ record_sessions_percent: {
266
+ description: 'Percentage of sessions to record for session recordings.',
267
+ label: 'Record Sessions Percent',
268
+ type: 'number',
269
+ default: 0,
270
+ minimum: 0,
271
+ maximum: 100
272
+ }
273
+ }