mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-10 16:15:01 -04:00
17 lines
467 B
TypeScript
17 lines
467 B
TypeScript
import Plausible, { type PlausibleOptions } from 'plausible-tracker';
|
|
import type { App } from 'vue';
|
|
|
|
const options: PlausibleOptions = {
|
|
domain: import.meta.env.VITE_PLAUSIBLE_DOMAIN,
|
|
apiHost: import.meta.env.VITE_PLAUSIBLE_API_HOST,
|
|
trackLocalhost: false,
|
|
};
|
|
|
|
export const plausible = {
|
|
install: (app: App) => {
|
|
const plausible = Plausible(options);
|
|
plausible.enableAutoPageviews();
|
|
|
|
app.config.globalProperties.$plausible = plausible;
|
|
},
|
|
};
|