feat: whyrating - initial project from turbostarter boilerplate
This commit is contained in:
25
apps/mobile/src/lib/providers/monitoring.tsx
Normal file
25
apps/mobile/src/lib/providers/monitoring.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import { useEffect } from "react";
|
||||
|
||||
import { initialize, identify } from "@turbostarter/monitoring-mobile";
|
||||
|
||||
import { authClient } from "~/lib/auth";
|
||||
|
||||
initialize();
|
||||
|
||||
export const MonitoringProvider = ({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) => {
|
||||
const session = authClient.useSession();
|
||||
|
||||
useEffect(() => {
|
||||
if (session.isPending) {
|
||||
return;
|
||||
}
|
||||
|
||||
identify(session.data?.user ?? null);
|
||||
}, [session]);
|
||||
|
||||
return children;
|
||||
};
|
||||
Reference in New Issue
Block a user