Skip to content

Commit a911309

Browse files
Merge pull request #1035 from ProvableHQ/feat/analytics-v2
[Feat] - Provable.Tools Analytics
2 parents 4dfa3a4 + 289ab0a commit a911309

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
},
4848
"homepage": "https://github.com/ProvableHQ/sdk#readme",
4949
"dependencies": {
50-
"@provablehq/wasm": "^0.8.8",
50+
"@provablehq/wasm": "^0.9.0",
5151
"comlink": "^4.4.2",
5252
"core-js": "^3.40.0",
5353
"mime": "^4.0.6",

website/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
"deploy": "gh-pages -d dist"
1515
},
1616
"dependencies": {
17+
"@amplitude/analytics-browser": "^2.16.1",
1718
"@ant-design/icons": "^5.6.0",
1819
"@codemirror/language": "^6.10.8",
1920
"@codemirror/legacy-modes": "^6.4.2",
2021
"@codemirror/stream-parser": "^0.19.9",
21-
"@provablehq/sdk": "^0.8.8",
22+
"@provablehq/sdk": "^0.9.0",
2223
"@uiw/codemirror-theme-noctis-lilac": "^4.23.7",
2324
"@uiw/codemirror-theme-okaidia": "^4.23.7",
2425
"@uiw/react-codemirror": "^4.23.7",

website/src/index.jsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@ import { createRoot } from "react-dom/client";
44
import { RouterProvider } from "react-router-dom";
55
import { router } from "./routing.jsx";
66
import WorkerProvider from "./workers/WorkerProvider.jsx";
7+
import { init } from '@amplitude/analytics-browser';
8+
import { autocapturePlugin } from '@amplitude/plugin-autocapture-browser';
9+
10+
// Initialize Amplitude with your API key
11+
const AMPLITUDE_API_KEY = import.meta.env.VITE_AMPLITUDE_API_KEY;
12+
13+
if (AMPLITUDE_API_KEY) {
14+
init(AMPLITUDE_API_KEY, {
15+
serverZone: "US",
16+
defaultTracking: {
17+
sessions: true,
18+
pageViews: true,
19+
formInteractions: true,
20+
fileDownloads: true,
21+
},
22+
plugins: [
23+
autocapturePlugin()
24+
]
25+
});
26+
}
727

828
const container = document.getElementById("root");
929
const root = createRoot(container);
@@ -32,4 +52,4 @@ const reportWebVitals = (onPerfEntry) => {
3252
// If you want to start measuring performance in your app, pass a function
3353
// to log results (for example: reportWebVitals(console.log))
3454
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
35-
reportWebVitals();
55+
reportWebVitals();

0 commit comments

Comments
 (0)