Highlight identifies users
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { H } from "highlight.run";
|
||||
import { useUserChanged } from "./useUser";
|
||||
|
||||
export function useHighlight() {
|
||||
useUserChanged((user) => {
|
||||
if (!user) {
|
||||
return;
|
||||
}
|
||||
|
||||
H.identify(user.id, {
|
||||
email: user.email,
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -29,6 +29,7 @@ import { usePostHog } from "./hooks/usePostHog";
|
||||
import { getUser } from "./services/session.server";
|
||||
import { appEnvTitleTag } from "./utils";
|
||||
import { ErrorBoundary as HighlightErrorBoundary } from "@highlight-run/react";
|
||||
import { useHighlight } from "./hooks/useHighlight";
|
||||
|
||||
export const links: LinksFunction = () => {
|
||||
return [{ rel: "stylesheet", href: tailwindStylesheetUrl }];
|
||||
@@ -96,6 +97,7 @@ function App() {
|
||||
const { posthogProjectKey, highlightProjectId } =
|
||||
useTypedLoaderData<typeof loader>();
|
||||
usePostHog(posthogProjectKey);
|
||||
useHighlight();
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user