@@ -93,6 +93,86 @@ export interface StackOptions {
9393 } ;
9494}
9595
96+ export interface BreadcrumbsOptions {
97+ /**
98+ * Set the maximum number of breadcrumbs. Defaults to 50.
99+ */
100+ maxBreadcrumbs ?: number ;
101+
102+ /**
103+ * True to enable automatic evaluation breadcrumbs. Defaults to true.
104+ */
105+ evaluations ?: boolean ;
106+
107+ /**
108+ * True to enable flag change breadcrumbs. Defaults to true.
109+ */
110+ flagChange ?: boolean ;
111+
112+ /**
113+ * True to enable click breadcrumbs. Defaults to true.
114+ */
115+ click ?: boolean ;
116+
117+ /**
118+ * True to enable input breadcrumbs for keypresses. Defaults to true.
119+ *
120+ * Input breadcrumbs do not include entered text, just that text was entered.
121+ */
122+ keyboardInput ?: boolean ;
123+
124+ /**
125+ * Controls instrumentation and breadcrumbs for HTTP requests.
126+ * The default is to instrument XMLHttpRequests and fetch requests.
127+ *
128+ * `false` to disable all HTTP breadcrumbs and instrumentation.
129+ *
130+ * Example:
131+ * ```
132+ * // This would instrument only XmlHttpRequests
133+ * http: {
134+ * instrumentFetch: false
135+ * instrumentXhr: true
136+ * }
137+ *
138+ * // Disable all HTTP instrumentation:
139+ * http: false
140+ * ```
141+ */
142+ http ?: HttpBreadcrumbOptions | false ;
143+
144+ /**
145+ * Custom breadcrumb filters.
146+ *
147+ * Can be used to redact or modify breadcrumbs.
148+ *
149+ * Example:
150+ * ```
151+ * // We want to redact any click events that include the message 'sneaky-button'
152+ * filters: [
153+ * (breadcrumb) => {
154+ * if(
155+ * breadcrumb.class === 'ui' &&
156+ * breadcrumb.type === 'click' &&
157+ * breadcrumb.message?.includes('sneaky-button')
158+ * ) {
159+ * return;
160+ * }
161+ * return breadcrumb;
162+ * }
163+ * ]
164+ * ```
165+ *
166+ * If you want to redact or modify URLs in breadcrumbs, then a urlFilter should be used.
167+ *
168+ * If any breadcrumb filters throw an exception while processing a breadcrumb, then that breadcrumb will be excluded.
169+ *
170+ * If any breadcrumbFilter cannot be executed, for example because it is not a function, then all breadcrumbs will
171+ * be excluded.
172+ */
173+ filters ?: BreadcrumbFilter [ ] ;
174+ }
175+
96176/**
97177 * Options for configuring browser telemetry.
98178 */
@@ -103,98 +183,21 @@ export interface Options {
103183 * events captured during initialization.
104184 */
105185 maxPendingEvents ?: number ;
186+
106187 /**
107- * Properties related to automatic breadcrumb collection.
188+ * Properties related to automatic breadcrumb collection, or `false` to disable automatic breadcrumbs .
108189 */
109- breadcrumbs ?: {
110- /**
111- * Set the maximum number of breadcrumbs. Defaults to 50.
112- */
113- maxBreadcrumbs ?: number ;
114-
115- /**
116- * True to enable automatic evaluation breadcrumbs. Defaults to true.
117- */
118- evaluations ?: boolean ;
119-
120- /**
121- * True to enable flag change breadcrumbs. Defaults to true.
122- */
123- flagChange ?: boolean ;
124-
125- /**
126- * True to enable click breadcrumbs. Defaults to true.
127- */
128- click ?: boolean ;
129-
130- /**
131- * True to enable input breadcrumbs for keypresses. Defaults to true.
132- *
133- * Input breadcrumbs do not include entered text, just that text was entered.
134- */
135- keyboardInput ?: boolean ;
136-
137- /**
138- * Controls instrumentation and breadcrumbs for HTTP requests.
139- * The default is to instrument XMLHttpRequests and fetch requests.
140- *
141- * `false` to disable all HTTP breadcrumbs and instrumentation.
142- *
143- * Example:
144- * ```
145- * // This would instrument only XmlHttpRequests
146- * http: {
147- * instrumentFetch: false
148- * instrumentXhr: true
149- * }
150- *
151- * // Disable all HTTP instrumentation:
152- * http: false
153- * ```
154- */
155- http ?: HttpBreadcrumbOptions | false ;
156-
157- /**
158- * Custom breadcrumb filters.
159- *
160- * Can be used to redact or modify breadcrumbs.
161- *
162- * Example:
163- * ```
164- * // We want to redact any click events that include the message 'sneaky-button'
165- * filters: [
166- * (breadcrumb) => {
167- * if(
168- * breadcrumb.class === 'ui' &&
169- * breadcrumb.type === 'click' &&
170- * breadcrumb.message?.includes('sneaky-button')
171- * ) {
172- * return;
173- * }
174- * return breadcrumb;
175- * }
176- * ]
177- * ```
178- *
179- * If you want to redact or modify URLs in breadcrumbs, then a urlFilter should be used.
180- *
181- * If any breadcrumb filters throw an exception while processing a breadcrumb, then that breadcrumb will be excluded.
182- *
183- * If any breadcrumbFilter cannot be executed, for example because it is not a function, then all breadcrumbs will
184- * be excluded.
185- */
186- filters ?: BreadcrumbFilter [ ] ;
187- } ;
190+ breadcrumbs ?: BreadcrumbsOptions | false ;
188191
189192 /**
190193 * Additional, or custom, collectors.
191194 */
192195 collectors ?: Collector [ ] ;
193196
194197 /**
195- * Configuration that controls the capture of the stack trace.
198+ * Configuration that controls the capture of the stack trace, or `false` to exclude stack frames from error events .
196199 */
197- stack ?: StackOptions ;
200+ stack ?: StackOptions | false ;
198201
199202 /**
200203 * Logger to use for warnings.
0 commit comments