feat: add Sentry and Plausible integrations
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import axios from 'axios';
|
||||
import * as Sentry from '@sentry/browser';
|
||||
|
||||
const baseUrl = () => localStorage.isBeta ? "https://api.beta.pluralkit.me" : "https://api.pluralkit.me";
|
||||
|
||||
@@ -9,7 +10,12 @@ const scheduled = [];
|
||||
const runAPI = () => {
|
||||
if (scheduled.length == 0) return;
|
||||
const {axiosData, res, rej} = scheduled.shift();
|
||||
axios(axiosData).then((resp) => res(parseData(resp.status, resp.data))).catch(rej);
|
||||
axios(axiosData)
|
||||
.then((resp) => res(parseData(resp.status, resp.data)))
|
||||
.catch((err) => {
|
||||
Sentry.captureException("Fetch error", err);
|
||||
rej(err);
|
||||
});
|
||||
}
|
||||
|
||||
setInterval(runAPI, 500);
|
||||
|
16
src/main.ts
16
src/main.ts
@@ -1,3 +1,19 @@
|
||||
import * as Sentry from "@sentry/browser";
|
||||
import { Integrations } from "@sentry/tracing";
|
||||
|
||||
Sentry.init({
|
||||
dsn: "https://58109fec589f4c2bbfa190329acf679a@sentry.pluralkit.me/4",
|
||||
integrations: [new Integrations.BrowserTracing()],
|
||||
|
||||
enabled: true,
|
||||
debug: false,
|
||||
release: "dev",
|
||||
// Set tracesSampleRate to 1.0 to capture 100%
|
||||
// of transactions for performance monitoring.
|
||||
// We recommend adjusting this value in production
|
||||
tracesSampleRate: 1.0,
|
||||
});
|
||||
|
||||
import App from './App.svelte'
|
||||
|
||||
const app = new App({
|
||||
|
Reference in New Issue
Block a user