Skip to content

Commit f07855d

Browse files
committed
docs: add sample rate to reduce analytics data points
1 parent ae3102a commit f07855d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/demo/main.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,17 @@ import { createApp } from "vue";
33
import { createPinia } from "pinia";
44
import Demo from "./Demo.vue";
55

6-
inject();
6+
const SAMPLE_RATE = 0.5;
7+
8+
inject({
9+
beforeSend: event => {
10+
if (Math.random() > SAMPLE_RATE) {
11+
return null;
12+
}
13+
14+
return event;
15+
}
16+
});
717

818
const pinia = createPinia();
919
const app = createApp(Demo);

0 commit comments

Comments
 (0)