Skip to content

Commit

Permalink
docs: add sample rate to reduce analytics data points
Browse files Browse the repository at this point in the history
  • Loading branch information
Justineo committed Apr 16, 2024
1 parent ae3102a commit f07855d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/demo/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@ import { createApp } from "vue";
import { createPinia } from "pinia";
import Demo from "./Demo.vue";

inject();
const SAMPLE_RATE = 0.5;

inject({
beforeSend: event => {
if (Math.random() > SAMPLE_RATE) {
return null;
}

return event;
}
});

const pinia = createPinia();
const app = createApp(Demo);
Expand Down

0 comments on commit f07855d

Please sign in to comment.