MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / usePylonWidgetConfig

Function usePylonWidgetConfig

apps/web/src/components/pylon-widget.tsx:66–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64}
65
66function usePylonWidgetConfig(): PylonWidgetConfig | null {
67 const appId = process.env.NEXT_PUBLIC_PYLON_APP_ID;
68 const { data: user } = useUser();
69
70 const { data: identity } = useQuery({
71 queryKey: ['pylon-identity', user?.id],
72 queryFn: fetchPylonIdentity,
73 enabled: Boolean(appId && user?.id),
74 staleTime: 5 * 60 * 1000,
75 });
76
77 return appId && identity ? { appId, identity } : null;
78}
79
80function setPylonChatState(next: Partial<PylonChatState>) {
81 const updated = { ...pylonChatState, ...next };

Callers 1

PylonWidgetFunction · 0.85

Calls 1

useUserFunction · 0.90

Tested by

no test coverage detected