@akinon/next 1.82.0-rc.8 → 1.82.0-rc.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @akinon/next
2
2
 
3
+ ## 1.82.0-rc.9
4
+
5
+ ### Minor Changes
6
+
7
+ - 9abd011: ZERO-3267: Refactor error handling in ErrorPage component to set error details in Sentry scope
8
+
3
9
  ## 1.82.0-rc.8
4
10
 
5
11
  ### Minor Changes
@@ -1,6 +1,9 @@
1
1
  'use client';
2
2
 
3
3
  import { useMobileIframeHandler } from '../hooks';
4
+ import * as Sentry from '@sentry/nextjs';
5
+ import { initSentry } from '../sentry';
6
+ import { useEffect } from 'react';
4
7
 
5
8
  export default function ClientRoot({
6
9
  children,
@@ -11,6 +14,23 @@ export default function ClientRoot({
11
14
  }) {
12
15
  const { preventPageRender } = useMobileIframeHandler({ sessionId });
13
16
 
17
+ const initializeSentry = async () => {
18
+ const response = await fetch('/api/sentry', { next: { revalidate: 0 } });
19
+ const data = await response.json();
20
+
21
+ const options = {
22
+ dsn: data.dsn
23
+ };
24
+
25
+ initSentry('Client', options);
26
+ };
27
+
28
+ useEffect(() => {
29
+ if (!Sentry.isInitialized()) {
30
+ initializeSentry();
31
+ }
32
+ }, []);
33
+
14
34
  if (preventPageRender) {
15
35
  return null;
16
36
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@akinon/next",
3
3
  "description": "Core package for Project Zero Next",
4
- "version": "1.82.0-rc.8",
4
+ "version": "1.82.0-rc.9",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -30,7 +30,7 @@
30
30
  "set-cookie-parser": "2.6.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@akinon/eslint-plugin-projectzero": "1.82.0-rc.8",
33
+ "@akinon/eslint-plugin-projectzero": "1.82.0-rc.9",
34
34
  "@types/react-redux": "7.1.30",
35
35
  "@types/set-cookie-parser": "2.4.7",
36
36
  "@typescript-eslint/eslint-plugin": "6.7.4",
package/sentry/index.ts CHANGED
@@ -21,6 +21,7 @@ export const initSentry = (
21
21
 
22
22
  Sentry.init({
23
23
  dsn:
24
+ options.dsn ||
24
25
  SENTRY_DSN ||
25
26
  'https://d8558ef8997543deacf376c7d8d7cf4b@o64293.ingest.sentry.io/4504338423742464',
26
27
  initialScope: {