MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / loader

Function loader

apps/webapp/app/root.tsx:39–58  ·  view source on GitHub ↗
({ request }: LoaderFunctionArgs)

Source from the content-addressed store, hash-verified

37};
38
39export const loader = async ({ request }: LoaderFunctionArgs) => {
40 const session = await getSession(request.headers.get("cookie"));
41 const toastMessage = session.get("toastMessage") as ToastMessage;
42 const posthogProjectKey = env.POSTHOG_PROJECT_KEY;
43 const highlightProjectId = env.HIGHLIGHT_PROJECT_ID;
44 const features = featuresForRequest(request);
45
46 return typedjson(
47 {
48 user: await getUser(request),
49 toastMessage,
50 posthogProjectKey,
51 highlightProjectId,
52 features,
53 appEnv: env.APP_ENV,
54 appOrigin: env.APP_ORIGIN,
55 },
56 { headers: { "Set-Cookie": await commitSession(session) } }
57 );
58};
59
60export type LoaderType = typeof loader;
61

Callers

nothing calls this directly

Calls 3

featuresForRequestFunction · 0.90
getUserFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…