MCPcopy Create free account
hub / github.com/Shopify/function-examples / loader

Function loader

sample-apps/discounts/app/routes/app.jsx:13–22  ·  view source on GitHub ↗
({ request })

Source from the content-addressed store, hash-verified

11export const links = () => [{ rel: "stylesheet", href: polarisStyles }];
12
13export async function loader({ request }) {
14 await authenticate.admin(request);
15
16 const url = new URL(request.url);
17
18 return json({
19 apiKey: process.env.SHOPIFY_API_KEY,
20 host: url.searchParams.get("host"),
21 });
22}
23
24export default function App() {
25 const { apiKey } = useLoaderData();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected