mirror of
https://github.com/hanzoai/ai.git
synced 2026-11-20 14:13:23 +00:00
The <script src="analytics.hanzo.ai/script.js" data-website-id> tag in public/index.html talked to a read LENS instead of the one ingestion front door, so the console could only ever produce pageviews — no errors, no product events. @hanzo/event POSTs api.hanzo.ai/v1/event, which Cloud fans server-side into the web (analytics), product (insights) and error (sentry) lenses; Cloud resolves the tenant, so there is no website id to keep in sync. Being in the bundle rather than the document also buys what a tag cannot: a pageview per client-side route change, window.onerror + unhandledrejection + a React ErrorBoundary on the same stream (no separate DSN), and identify() by the account's stable id — never email or any other PII. Global Privacy Control / Do-Not-Track disables the client outright. Co-authored-by: Hanzo Dev <[email protected]>
43 lines
1.3 KiB
Go
43 lines
1.3 KiB
Go
// Copyright 2023 Hanzo AI Inc. All Rights Reserved.
|
|
// Portions Copyright 2023 The OpenAgent Authors. All Rights Reserved.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
import "react-app-polyfill/ie9";
|
|
import "react-app-polyfill/stable";
|
|
|
|
import React from "react";
|
|
import {createRoot} from "react-dom/client";
|
|
import "./globals.css";
|
|
import "./font.css";
|
|
import App from "./App";
|
|
import {Analytics} from "./Analytics";
|
|
import * as serviceWorker from "./serviceWorker";
|
|
import {BrowserRouter} from "react-router-dom";
|
|
import "./i18n";
|
|
import "./backend/FetchFilter";
|
|
|
|
const container = document.getElementById("root");
|
|
|
|
const app = createRoot(container);
|
|
|
|
app.render(
|
|
<BrowserRouter>
|
|
<Analytics>
|
|
<App />
|
|
</Analytics>
|
|
</BrowserRouter>
|
|
);
|
|
|
|
serviceWorker.unregister();
|