@formo/analytics 1.11.4 → 1.11.5-alpha.2
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/.env.example +1 -0
- package/dist/cjs/src/FormoAnalyticsProvider.d.ts.map +1 -1
- package/dist/cjs/src/FormoAnalyticsProvider.js +19 -15
- package/dist/cjs/src/FormoAnalyticsProvider.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/src/FormoAnalyticsProvider.d.ts.map +1 -1
- package/dist/esm/src/FormoAnalyticsProvider.js +19 -15
- package/dist/esm/src/FormoAnalyticsProvider.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/FormoAnalyticsProvider.tsx +21 -15
package/package.json
CHANGED
|
@@ -10,6 +10,8 @@ import { FormoAnalyticsProviderProps } from './types';
|
|
|
10
10
|
import { ErrorBoundary } from '@highlight-run/react';
|
|
11
11
|
import { H } from 'highlight.run';
|
|
12
12
|
|
|
13
|
+
const HIGHLIGHT_PROJECT_ID = process.env.REACT_APP_HIGHLIGHT_PROJECT_ID;
|
|
14
|
+
|
|
13
15
|
export const FormoAnalyticsContext = createContext<FormoAnalytics | undefined>(
|
|
14
16
|
undefined
|
|
15
17
|
);
|
|
@@ -23,6 +25,8 @@ export const FormoAnalyticsProvider = ({
|
|
|
23
25
|
const [sdk, setSdk] = useState<FormoAnalytics | undefined>();
|
|
24
26
|
const initializedStartedRef = useRef(false);
|
|
25
27
|
|
|
28
|
+
console.log(HIGHLIGHT_PROJECT_ID);
|
|
29
|
+
|
|
26
30
|
useEffect(() => {
|
|
27
31
|
if (!apiKey) {
|
|
28
32
|
throw new Error('FormoAnalyticsProvider: No API key provided');
|
|
@@ -33,20 +37,22 @@ export const FormoAnalyticsProvider = ({
|
|
|
33
37
|
if (initializedStartedRef.current) return;
|
|
34
38
|
initializedStartedRef.current = true;
|
|
35
39
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
40
|
+
if (HIGHLIGHT_PROJECT_ID) {
|
|
41
|
+
H.init(process.env.HIGHLIGHT_PROJECT_ID, {
|
|
42
|
+
serviceName: 'formo-analytics-sdk',
|
|
43
|
+
tracingOrigins: true,
|
|
44
|
+
networkRecording: {
|
|
45
|
+
enabled: true,
|
|
46
|
+
recordHeadersAndBody: true,
|
|
47
|
+
urlBlocklist: [
|
|
48
|
+
// insert full or partial urls that you don't want to record here
|
|
49
|
+
// Out of the box, Highlight will not record these URLs (they can be safely removed):
|
|
50
|
+
'https://www.googleapis.com/identitytoolkit',
|
|
51
|
+
'https://securetoken.googleapis.com',
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
50
56
|
|
|
51
57
|
FormoAnalytics.init(apiKey, projectId).then((sdkInstance) =>
|
|
52
58
|
setSdk(sdkInstance)
|
|
@@ -54,7 +60,7 @@ export const FormoAnalyticsProvider = ({
|
|
|
54
60
|
}, [apiKey, disabled, projectId]);
|
|
55
61
|
|
|
56
62
|
return (
|
|
57
|
-
<ErrorBoundary onError={(error, info) => H
|
|
63
|
+
<ErrorBoundary onError={(error, info) => H?.consumeError(error, info)}>
|
|
58
64
|
<FormoAnalyticsContext.Provider value={sdk}>
|
|
59
65
|
{children}
|
|
60
66
|
</FormoAnalyticsContext.Provider>
|