Skip to content

Commit

Permalink
feat(posthog): Emit user activated event (#4886)
Browse files Browse the repository at this point in the history
  • Loading branch information
amanape authored Nov 11, 2024
1 parent 975e755 commit 80fdb9a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frontend/src/routes/_oh.app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import { useDispatch, useSelector } from "react-redux";
import WebSocket from "ws";
import toast from "react-hot-toast";
import posthog from "posthog-js";
import { getSettings } from "#/services/settings";
import Security from "../components/modals/security/Security";
import { Controls } from "#/components/controls";
Expand Down Expand Up @@ -159,6 +160,11 @@ function App() {
const sendInitialQuery = (query: string, base64Files: string[]) => {
const timestamp = new Date().toISOString();
send(createChatMessage(query, base64Files, timestamp));

const userSettings = getSettings();
if (userSettings.LLM_API_KEY) {
posthog.capture("user_activated");
}
};

const handleOpen = React.useCallback(() => {
Expand Down

0 comments on commit 80fdb9a

Please sign in to comment.