Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import starlight from "@astrojs/starlight";
import sentry from "@sentry/astro";
import { defineConfig } from "astro/config";

// Allow base path override via environment variable for PR previews
Expand All @@ -8,6 +9,14 @@ export default defineConfig({
site: "https://cli.sentry.dev",
base,
integrations: [
sentry({
project: "cli-website",
org: "sentry",
authToken: process.env.SENTRY_AUTH_TOKEN,
sourceMapsUploadOptions: {
enabled: !!process.env.SENTRY_AUTH_TOKEN,
},
}),
starlight({
title: "Sentry CLI",
favicon: "/favicon.png",
Expand Down
353 changes: 353 additions & 0 deletions docs/bun.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"dependencies": {
"@astrojs/starlight": "^0.31.1",
"@sentry/astro": "^10.38.0",
"astro": "^5.1.1",
"sharp": "^0.33.5",
"shiki": "^3.21.0"
Expand Down
21 changes: 21 additions & 0 deletions docs/sentry.client.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import * as Sentry from "@sentry/astro";

Sentry.init({
dsn: "https://2aca5fe97c71868bc3aa7fb48620dc39@o1.ingest.us.sentry.io/4510798755856384",
sendDefaultPii: true,
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration(),
],
enableLogs: true,
tracesSampleRate: 1.0,
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0,
// Enable in all environments (including development)
enabled: true,
// Uncomment to debug Sentry initialization
// debug: true,
});

// Expose globally for inline scripts
window.Sentry = Sentry;
10 changes: 10 additions & 0 deletions docs/sentry.server.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as Sentry from "@sentry/astro";

Sentry.init({
dsn: "https://2aca5fe97c71868bc3aa7fb48620dc39@o1.ingest.us.sentry.io/4510798755856384",
sendDefaultPii: true,
enableLogs: true,
tracesSampleRate: 1.0,
// Enable in all environments (including development)
enabled: true,
});
25 changes: 24 additions & 1 deletion docs/src/components/InstallSelector.astro
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,18 @@ const defaultOption = highlightedOptions[defaultIndex];
});
option.classList.add('selected');
option.setAttribute('aria-selected', 'true');


// Track install method selection with Sentry metrics
try {
if (typeof Sentry !== 'undefined' && Sentry.metrics && newLabel) {
Sentry.metrics.count('hero_install_method_selected', 1, {
attributes: { install_method: newLabel },
});
}
} catch (e) {
// Sentry not available, ignore
}

// Close dropdown and return focus
installBox.classList.remove('open');
trigger.setAttribute('aria-expanded', 'false');
Expand Down Expand Up @@ -461,6 +472,18 @@ const defaultOption = highlightedOptions[defaultIndex];
await navigator.clipboard.writeText(command);
copyBtn.classList.add('copied');
setTimeout(function() { copyBtn.classList.remove('copied'); }, 2000);

// Track copy event with Sentry metrics
try {
if (typeof Sentry !== 'undefined' && Sentry.metrics) {
const installMethod = label ? label.textContent : 'unknown';
Sentry.metrics.count('hero_command_copied', 1, {
attributes: { install_method: installMethod },
});
}
} catch (e) {
// Sentry not available, ignore
}
}
});
}
Expand Down
Loading