---
title: Unauthenticated storefront
description: >-
  Allows interacting with the Storefront API on requests that didn't come from
  Shopify.
api_version: v1
source_url:
  html: >-
    https://shopify.dev/docs/api/shopify-app-remix/v1/unauthenticated/unauthenticated-storefront
  md: >-
    https://shopify.dev/docs/api/shopify-app-remix/v1/unauthenticated/unauthenticated-storefront.md
api_name: shopify-app-remix
---

# 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.

## unauthenticated.​storefront(**[shop](#unauthenticatedstorefront-propertydetail-shop)**​)

Creates an unauthenticated Storefront context.

### Parameters

* **shop**

  **string**

  **required**

### Returns

* **Promise\<UnauthenticatedStorefrontContext>**

### UnauthenticatedStorefrontContext

* session

  The session for the given shop. This comes from the session storage which \`shopifyApp\` uses to store sessions in your database of choice. This will always be an offline session. You can use this to get shop specific data.

  ```ts
  Session
  ```

* storefront

  Method for interacting with the Shopify GraphQL Storefront API for the given store.

  ```ts
  StorefrontContext
  ```

### StorefrontContext

Provides utilities that apps can use to make requests to the Storefront API.

* graphql

  Method for interacting with the Shopify Storefront GraphQL API If you're getting incorrect type hints in the Shopify template, follow \[these instructions]\(https://github.com/Shopify/shopify-app-template-remix/tree/main#incorrect-graphql-hints).

  ```ts
  GraphQLClient
  ```

### GraphQLClient

* query

  ```ts
  string
  ```

* options

  ```ts
  GraphQLQueryOptions
  ```

returns

```ts
Promise<Response>
```

### GraphQLQueryOptions

* apiVersion

  ```ts
  ApiVersion
  ```

* headers

  ```ts
  { [key: string]: any; }
  ```

* tries

  ```ts
  number
  ```

* variables

  ```ts
  QueryVariables
  ```

### QueryVariables

* \[key: string]

  ```ts
  any
  ```

Examples

### Examples

* ####

  ##### Description

  Get your app's shop-specific data using the returned offline \`session\` object.

  ##### app/routes/\*\*\\/.ts

  ```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));
  };
  ```

* ####

  ##### Description

  Use \`storefront.graphql\` to make query / mutation requests.

  ##### Example

  ```ts
  import { ActionArgs } from "@remix-run/node";
  import { authenticate } from "../shopify.server";

  export async function action({ request }: ActionArgs) {
    const { storefront } = await authenticate.storefront(request);

    const response = await storefront.graphql(`{blogs(first: 10) { edges { node { id } } } }`);

    const productData = await response.json();
    return json({ data: productData.data });
  }
  ```

***

## Related

[Interact with the Storefront API. - API context](https://shopify.dev/docs/api/shopify-app-remix/v1/apis/storefront-api)

***
