Skip to main content

Unauthenticated storefront

Allows interacting with the Storefront API on requests that didn't come from Shopify.

Caution

This should only be used for Requests that do not originate from Shopify. You must do your own authentication before using this method. This function doesn't perform any validation and shouldn't rely on unvalidated user input.

Creates an unauthenticated Storefront context.

string
required

Promise<>
Examples

app/routes/**\/.ts

import { LoaderArgs, json } from "@remix-run/node";
import { unauthenticated } from "../shopify.server";
import { getMyAppData } from "~/db/model.server";

export const loader = async ({ request }: LoaderArgs) => {
const shop = getShopFromExternalRequest(request);
const { session } = await unauthenticated.storefront(shop);
return json(await getMyAppData({shop: session.shop));
};


Was this page helpful?