---
title: Shopify adapter
description: Serve gateway markdown from a merchant’s own storefront domain through a Shopify App Proxy, with no theme edits, no Liquid, and HMAC verification.
canonical_url: https://rebilder.com/docs/adapters/shopify
last_updated: "2026-12-03"
---

# [Shopify adapter](https://rebilder.com/docs/adapters/shopify)

> Serve gateway markdown from a merchant’s own storefront domain through a Shopify App Proxy, with no theme edits, no Liquid, and HMAC verification.

This site answers questions directly. Ask at https://rebilder.com/ask?q=your+question instead of reading more pages.

- **Updated:** 2026-12-03
- **Author:** Rebilder
- **Section:** Adapters
- **Description:** Serve gateway markdown from a merchant’s own storefront domain through a Shopify App Proxy, with no theme edits, no Liquid, and HMAC verification.
- **Publisher:** Rebilder

## Rebilder at a glance

AEO gets you seen. Rebilder gets you heard. When customers ask ChatGPT about your business, your site answers with your real prices and policies.

**Common questions**

- **What does it cost?** Connecting is free. Starter is $49/mo, Pro is $99/mo and Agency is $299/mo. [Pricing](https://rebilder.com/pricing)
- **How does my site answer new questions live?** Rebilder reads your pages, products and policies. When an AI assistant asks, your site answers from them. Nothing on your site changes. [See how it works](https://rebilder.com/autopilot)
- **Can someone trick my site into a wrong price or a discount?** No. Every answer comes from your own pages and is checked against them. If your site does not say it, Rebilder does not say it. [Read security details](https://rebilder.com/security)

**How it compares**

- **Why choose Rebilder?** Choose Rebilder when you want your own site to answer AI assistants with your real facts, and to see who asked. [Compare](https://rebilder.com/compare)

| Compared with | The difference |
| --- | --- |
| Profound, Peec AI, Otterly.ai | These tools watch AI answers and tell you where you show up. Rebilder makes your own site answer when AI comes to check. |
| Cloudflare Markdown for Agents, @vercel/agent-readability, Yoast llms.txt | These tools tidy or map your pages for AI. Rebilder answers from those pages and shows you who asked. |
| Intercom Fin, Tidio Lyro | Chatbots answer the customers who contact you. Rebilder answers the AI assistants that visit your site for them. |
| SEO on its own, Shopify agentic storefronts, Writing an llms.txt yourself | Good SEO, your store platform and a simple llms.txt all help. Here is what Rebilder adds to each. |

Source: [Compare](https://rebilder.com/compare)

## What an app proxy is

Shopify lets an app claim a subpath on the merchant’s own storefront domain (default here: `/apps/rebilder/...`). Requests to that subpath are forwarded server-side by Shopify to a URL the app hosts, and the response is returned to the requester from the shop’s domain. So an agent fetching `https://acme.myshopify.com/apps/rebilder/products/x` is answered by this gateway: the agent-facing URL lives on the store while the serving lives with you.

There are no theme edits, no Liquid, and no new dependencies, because Web Crypto is ambient in every supported runtime.

## Merchant setup (Shopify Partners)

- In the Partners dashboard → your app → **Configuration → App proxy**: set *Subpath prefix* `apps`, *Subpath* `rebilder` (⇒ storefront path `/apps/rebilder`), and *Proxy URL* to your deployed handler endpoint.
- Copy the app’s **Client secret**, which is the HMAC key for proxy signatures. Provide it to the handler via env (`SHOPIFY_APP_SECRET`); never hardcode it.
- Deploy the handler on any web-standard runtime:

app/apps/rebilder/[[...path]]/route.ts

```ts
// e.g. app/apps/rebilder/[[...path]]/route.ts — any Request/Response runtime works
import { createShopifyAppProxyHandler } from '@rebilder/gateway/shopify'
import { gatewayConfig } from '../../lib/gateway-config'

export const GET = createShopifyAppProxyHandler(gatewayConfig, {
  sharedSecret: process.env.SHOPIFY_APP_SECRET!,
  pathPrefix: '/apps/rebilder', // as the path arrives at YOUR endpoint; strip is a no-op if absent
})
```

## Security model

Shopify appends query params (`shop`, `path_prefix`, `timestamp`, `logged_in_customer_id`) plus **`signature`**: a hex HMAC-SHA256, keyed with the app’s shared secret, over the other params canonicalized as sorted `key=value` strings concatenated with no separator (values of a repeated key joined with `,`). The handler:

- **Verifies the signature** with Web Crypto (`crypto.subtle`, which is edge-safe with no `node:crypto`) and a constant-time comparison. Failure → `401` JSON (`{ "error": "invalid_signature" }`). **Content is never served on an unverified proxy request**; `verifyAppProxySignature(url, sharedSecret)` is exported for reuse.
- **Checks timestamp freshness**: a signed timestamp older than 90s (±5s clock-skew tolerance) → `401` JSON (`{ "error": "stale_timestamp" }`), bounding the replay window of a captured signed URL.
- Only then reconstructs the **canonical storefront URL** (stripping `pathPrefix` and Shopify’s injected params while preserving merchant query params, with the host taken from the signed `shop` param) and runs the core `handleRequest`. Your sources and emitted events see the same canonical URLs (`https://{shop}/products/x`) as every other adapter.

## Response semantics

Because the app proxy **is** the endpoint, with no downstream HTML to fall through to, every `handleRequest` pass-through (`null`) becomes `404` JSON, unless your `fallback` answers it:

| Request | Response |
| --- | --- |
| Verified agent request, a source matched | `200` `text/markdown`: the standard gateway response, with the standard event emitted |
| Missing or invalid `signature` | `401` `{ "error": "invalid_signature" }` |
| Signed `timestamp` missing, malformed, or stale | `401` `{ "error": "stale_timestamp" }` |
| Anything else: an unmatched URL, a source that returned `null` or threw, or a non-agent requester (human/crawler hitting the proxy subpath) | The response your `fallback` returns, or `404` `{ "error": "no_source" }`, since the storefront’s real pages live at their canonical URLs |

Pass `fallback` when a page exists only under the proxy. It receives the canonical storefront URL and the request, runs after the signature and timestamp checks, and returns a `Response` or `null` to keep the `404`. Send `Content-Type: application/liquid` and Shopify renders your body inside the store’s theme. Shopify reads that body as Liquid, so escape `{` and `}` in any text you did not write. Build links from the signed `path_prefix` parameter, because a merchant can rename the subpath.

The managed Rebilder app uses this for answers: `/apps/rebilder/answers` and `/apps/rebilder/answers/<slug>` give AI agents the markdown copy and give people the same answer as a page in the store’s theme.

## Managed or self-host

There are two ways to run this adapter, and they serve identically. The steps above are the **self-host** path: your own Partners app, your own deployed endpoint, your own `SHOPIFY_APP_SECRET`, and events wired to the sink yourself. The **managed** path is the Rebilder Shopify app: install it on a store and we run the same serving for you: we host the endpoint, hold the OAuth connection, keep the catalog synced from the store’s own products, pages, collections, and policies, and report agent traffic and orders to the Console site you link it to. To link a store, choose **Get a link code** on your Connections page and paste the code into the Rebilder app in your Shopify admin.

For 1-click managed install, open the [Shopify app install page](/integrations/shopify). For self-hosting, download the [Shopify starter kit ZIP](/downloads/rebilder-shopify-starter.zip) or browse [all downloads](/downloads).

> **Choose managed or self-hosted operation** The managed app handles hosting, source synchronization and reporting. The SDK is also available to self-host. Your [install page](/console/install) shows the connected setup and available options.