Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

feat: add Sentry console logging integration and user report dialog

Enno Gelhaus24ae266041e3
diff --git a/libraries/react-shared-libraries/src/sentry/initialize.sentry.next.basic.ts b/libraries/react-shared-libraries/src/sentry/initialize.sentry.next.basic.ts
index c9361650a..0d8a64f3d 100644
--- a/libraries/react-shared-libraries/src/sentry/initialize.sentry.next.basic.ts
+++ b/libraries/react-shared-libraries/src/sentry/initialize.sentry.next.basic.ts
@@ -29,6 +29,9 @@ export const initializeSentryBasic = (environment: string, dsn: string, extensio
},
},
},
+ integrations: [
+ Sentry.consoleLoggingIntegration({ levels: ['log', 'info', 'warn', 'error', 'debug', 'assert', 'trace'] }),
+ ],
environment: environment || 'development',
dsn,
sendDefaultPii: true,
@@ -47,10 +50,36 @@ export const initializeSentryBasic = (environment: string, dsn: string, extensio
}
}
}
+
+ // If there's an exception and an event id, present the user report dialog.
+ if (event.event_id) {
+ // Only attempt to show the dialog in a browser environment.
+ if (typeof window !== 'undefined' && window.document) {
+ // Dynamically import the package that exports showReportDialog to avoid
+ // bundler errors when this shared lib is used in non-browser builds.
+ import('@sentry/react')
+ .then((mod) => {
+ try {
+ mod.showReportDialog({ eventId: event.event_id });
+ } catch (err) {
+ // eslint-disable-next-line no-console
+ console.error('Sentry.showReportDialog failed:', err);
+ }
+ })
+ .catch((importErr) => {
+ // eslint-disable-next-line no-console
+ console.error('Failed to import @sentry/react for report dialog:', importErr);
+ });
+ }
+ }
}
return event; // Send the event to Sentry
},
});
- } catch (err) {}
+ } catch (err) {
+ // Log initialization errors
+ // eslint-disable-next-line no-console
+ console.error('Sentry.init failed:', err);
+ }
};
diff --git a/package.json b/package.json
index ab2ca86c1..d6446ba6b 100644
--- a/package.json
+++ b/package.json
@@ -79,6 +79,7 @@
"@postiz/wallets": "^0.0.1",
"@prisma/client": "6.5.0",
"@sentry/nestjs": "^10.25.0",
+ "@sentry/react": "^10.25.0",
"@sentry/nextjs": "^10.25.0",
"@sentry/profiling-node": "^10.25.0",
"@solana/wallet-adapter-react": "^0.15.35",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 1c78d8e3e..e3d402cc4 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -11,7 +11,7 @@ importers:
dependencies:
'@ag-ui/mastra':
specifier: 0.2.0
'@ai-sdk/openai':
specifier: ^2.0.52
version: 2.0.68([email protected])
@@ -38,7 +38,7 @@ importers:
'@copilotkit/runtime':
specifier: 1.10.6
- version: 1.10.6(9c0ec131fe3ef529a831958f12b4bf78)
+ version: 1.10.6(6855d89fee41a5dd20a0f9576445cd9f)
'@hookform/resolvers':
specifier: ^3.3.4
@@ -123,6 +123,9 @@ importers:
'@sentry/profiling-node':
specifier: ^10.25.0
version: 10.26.0
+ '@sentry/react':
+ specifier: ^10.25.0
+ version: 10.26.0([email protected])
'@solana/wallet-adapter-react':
specifier: ^0.15.35
@@ -6065,6 +6068,7 @@ packages:
'@smithy/[email protected]':
resolution: {integrity: sha512-o5tMqPZILBvvROfC8vC+dSVnWJl9a0u9ax1i1+Bq8515eYjUJqqk5XjjEsDLoeL5dSqGSh6WGdVx1eJ1E/Nwhw==}
engines: {node: '>=18.0.0'}
+ deprecated: Please upgrade your lockfile to use the latest 3.x version of @smithy/core for various fixes, see https://github.com/smithy-lang/smithy-typescript/blob/main/packages/core/CHANGELOG.md
'@smithy/[email protected]':
resolution: {integrity: sha512-BZwotjoZWn9+36nimwm/OLIcVe+KYRwzMjfhd4QT7QxPm9WY0HiOV8t/Wlh+HVUif0SBVV7ksq8//hPaBC/okQ==}
@@ -8128,9 +8132,11 @@ packages:
'@walletconnect/[email protected]':
resolution: {integrity: sha512-+GkuJzPK9SPq+RZgdKHNOvgRagxh/hhYWFHOeSiGh3DyAQofWuFTq4UrN/MPjKOYswSSBKfIa+iqKYsi4t8zLQ==}
+ deprecated: 'Reliability and performance improvements. See: https://github.com/WalletConnect/walletconnect-monorepo/releases'
'@walletconnect/[email protected]':
resolution: {integrity: sha512-OgBHRPo423S02ceN3lAzcZ3MYb1XuLyTTkKqLmKp/icYZCyRzm3/ynqJDKndiBLJ5LTic0y07LiZilnliYqlvw==}
+ deprecated: 'Reliability and performance improvements. See: https://github.com/WalletConnect/walletconnect-monorepo/releases'
'@walletconnect/[email protected]':
resolution: {integrity: sha512-Qb7MT8SdkeBldfUCmF+rYW6vL98mxPuT1yAwww5X2vpx7xEPZvFCoAKnyT5fXu0v56rMxhW3MGejnHyyYdDY7Q==}
@@ -8149,9 +8155,11 @@ packages:
'@walletconnect/[email protected]':
resolution: {integrity: sha512-e9JvadT5F8QwdLmd7qBrmACq04MT7LQEe1m3X2Fzvs3DWo8dzY8QbacnJy4XSv5PCdxMWnua+2EavBk8nrI9QA==}
+ deprecated: 'Reliability and performance improvements. See: https://github.com/WalletConnect/walletconnect-monorepo/releases'
'@walletconnect/[email protected]':
resolution: {integrity: sha512-4rdLvJ2TGDIieNWW3sZw2MXlX65iHpTuKb5vyvUHQtjIVNLj+7X/09iUAI/poswhtspBK0ytwbH+AIT/nbGpjg==}
+ deprecated: 'Reliability and performance improvements. See: https://github.com/WalletConnect/walletconnect-monorepo/releases'
'@walletconnect/[email protected]':
resolution: {integrity: sha512-LZ0D8kevknKfrfA0Sq3Hf3PpmM8oWyNfsyWwFR51t//2LBgtN2Amz5xyoDDJcjLibIbKAxpuo/i0JYAQxz+aPA==}
@@ -16914,10 +16922,10 @@ snapshots:
'@ag-ui/core': 0.0.41
'@ag-ui/proto': 0.0.41
dependencies:
'@ag-ui/client': 0.0.41
- '@ag-ui/core': 0.0.37
+ '@ag-ui/core': 0.0.41
'@langchain/core': 0.3.79(@opentelemetry/[email protected])(@opentelemetry/[email protected](@opentelemetry/[email protected]))(@opentelemetry/[email protected](@opentelemetry/[email protected]))([email protected]([email protected]([email protected])([email protected]))([email protected]))
partial-json: 0.1.7
@@ -16930,12 +16938,12 @@ snapshots:
- react
- react-dom
dependencies:
'@ag-ui/client': 0.0.41
- '@ag-ui/core': 0.0.37
+ '@ag-ui/core': 0.0.41
'@ai-sdk/ui-utils': 1.2.11([email protected])
- '@copilotkit/runtime': 1.10.6(9c0ec131fe3ef529a831958f12b4bf78)
+ '@copilotkit/runtime': 1.10.6(6855d89fee41a5dd20a0f9576445cd9f)
rxjs: 7.8.1
@@ -18876,12 +18884,12 @@ snapshots:
- encoding
- graphql
- '@copilotkit/[email protected](9c0ec131fe3ef529a831958f12b4bf78)':
+ '@copilotkit/[email protected](6855d89fee41a5dd20a0f9576445cd9f)':
dependencies:
'@ag-ui/client': 0.0.41
- '@ag-ui/core': 0.0.37
+ '@ag-ui/core': 0.0.41
'@ag-ui/encoder': 0.0.41
'@ag-ui/proto': 0.0.41
'@anthropic-ai/sdk': 0.57.0
'@copilotkit/shared': 1.10.6