Skip to content

Commit eeab4c1

Browse files
ericnograleskamilogorek
authored andcommitted
feat: Adds attachProps config option to Vue integration (#1885)
1 parent 67360d0 commit eeab4c1

File tree

1 file changed

+12
-2
lines changed
  • packages/browser/src/integrations/pluggable

1 file changed

+12
-2
lines changed

packages/browser/src/integrations/pluggable/vue.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,22 @@ export class Vue implements Integration {
3030
*/
3131
private readonly Vue: any; // tslint:disable-line:variable-name
3232

33+
/**
34+
* When set to false, Sentry will suppress reporting all props data
35+
* from your Vue components for privacy concerns.
36+
*/
37+
private readonly attachProps: boolean;
38+
3339
/**
3440
* @inheritDoc
3541
*/
36-
public constructor(options: { Vue?: any } = {}) {
42+
public constructor(options: { Vue?: any; attachProps?: boolean } = {}) {
3743
this.Vue =
3844
options.Vue ||
3945
(getGlobalObject() as {
4046
Vue: any;
4147
}).Vue;
48+
this.attachProps = options.attachProps || true;
4249
}
4350

4451
/** JSDoc */
@@ -69,7 +76,10 @@ export class Vue implements Integration {
6976

7077
if (isPlainObject(vm)) {
7178
metadata.componentName = this.formatComponentName(vm);
72-
metadata.propsData = vm.$options.propsData;
79+
80+
if (this.attachProps) {
81+
metadata.propsData = vm.$options.propsData;
82+
}
7383
}
7484

7585
if (!isUndefined(info)) {

0 commit comments

Comments
 (0)