feat: add sentry

This commit is contained in:
Tony Yang
2025-04-17 00:36:59 +08:00
parent d3ea3c33b8
commit c3df80671a
4 changed files with 44 additions and 1 deletions
+11
View File
@@ -0,0 +1,11 @@
import * as Sentry from "@sentry/cloudflare";
export const onRequest = [
Sentry.sentryPagesPlugin((context) => ({
dsn: "https://9d2c460f5e6bca67a47fa821860dceef@o4506857623453696.ingest.us.sentry.io/4509163928944640",
// Set tracesSampleRate to 1.0 to capture 100% of spans for tracing.
// Learn more at
// https://docs.sentry.io/platforms/javascript/configuration/options/#traces-sample-rate
tracesSampleRate: 1.0,
}))
];
+31 -1
View File
@@ -11,6 +11,7 @@
"@cloudflare/pages-plugin-hcaptcha": "^1.0.4", "@cloudflare/pages-plugin-hcaptcha": "^1.0.4",
"@cloudflare/pages-plugin-turnstile": "^1.0.2", "@cloudflare/pages-plugin-turnstile": "^1.0.2",
"@hcaptcha/vue3-hcaptcha": "^1.3.0", "@hcaptcha/vue3-hcaptcha": "^1.3.0",
"@sentry/cloudflare": "^9.13.0",
"file-type": "^20.4.1", "file-type": "^20.4.1",
"jose": "^6.0.10", "jose": "^6.0.10",
"pinia": "^3.0.2", "pinia": "^3.0.2",
@@ -88,7 +89,7 @@
"version": "4.20250412.0", "version": "4.20250412.0",
"resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20250412.0.tgz", "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20250412.0.tgz",
"integrity": "sha512-ukQE+TRc5HNkM6VvGfTNC9x54TLQKjdcm624F8Qh1ZRe0iJrW2/j1eYgvJABJPexDousYCR7VzCGteShLcBJYQ==", "integrity": "sha512-ukQE+TRc5HNkM6VvGfTNC9x54TLQKjdcm624F8Qh1ZRe0iJrW2/j1eYgvJABJPexDousYCR7VzCGteShLcBJYQ==",
"dev": true, "devOptional": true,
"license": "MIT OR Apache-2.0" "license": "MIT OR Apache-2.0"
}, },
"node_modules/@esbuild/aix-ppc64": { "node_modules/@esbuild/aix-ppc64": {
@@ -838,6 +839,35 @@
"win32" "win32"
] ]
}, },
"node_modules/@sentry/cloudflare": {
"version": "9.13.0",
"resolved": "https://registry.npmjs.org/@sentry/cloudflare/-/cloudflare-9.13.0.tgz",
"integrity": "sha512-XaG/Kl5dSUJtzYkalQjaejGhrgFoj5w3cSWoXkxd8J+LXHsq7BFg4S0uCkzGJUmDHItlzfEY8BIaPpgPTJL7MQ==",
"license": "MIT",
"dependencies": {
"@sentry/core": "9.13.0"
},
"engines": {
"node": ">=18"
},
"peerDependencies": {
"@cloudflare/workers-types": "^4.x"
},
"peerDependenciesMeta": {
"@cloudflare/workers-types": {
"optional": true
}
}
},
"node_modules/@sentry/core": {
"version": "9.13.0",
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-9.13.0.tgz",
"integrity": "sha512-Zn1Qec5XNkNRE/M5QjL6YJLghETg6P188G/v2OzdHdHIRf0Y58/SnJilu3louF+ogos6kaSqqdMgzqKgZ8tCdg==",
"license": "MIT",
"engines": {
"node": ">=18"
}
},
"node_modules/@tokenizer/inflate": { "node_modules/@tokenizer/inflate": {
"version": "0.2.7", "version": "0.2.7",
"resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.2.7.tgz", "resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.2.7.tgz",
+1
View File
@@ -18,6 +18,7 @@
"@cloudflare/pages-plugin-hcaptcha": "^1.0.4", "@cloudflare/pages-plugin-hcaptcha": "^1.0.4",
"@cloudflare/pages-plugin-turnstile": "^1.0.2", "@cloudflare/pages-plugin-turnstile": "^1.0.2",
"@hcaptcha/vue3-hcaptcha": "^1.3.0", "@hcaptcha/vue3-hcaptcha": "^1.3.0",
"@sentry/cloudflare": "^9.13.0",
"file-type": "^20.4.1", "file-type": "^20.4.1",
"jose": "^6.0.10", "jose": "^6.0.10",
"pinia": "^3.0.2", "pinia": "^3.0.2",
+1
View File
@@ -1,5 +1,6 @@
name = "ntu-awd-website" name = "ntu-awd-website"
pages_build_output_dir = "dist" pages_build_output_dir = "dist"
compatibility_flags = ["nodejs_compat"]
compatibility_date = "2025-04-12" compatibility_date = "2025-04-12"
[vars] [vars]