Storeware Docs

App proxy

Answer a shopper’s request for a page under the shop’s address.

import { ... } from '@storeware/plugin-sdk';

verifyProxyRequest

Verifies a request Storeware forwarded from a shop's /apps/<slug>/ path and returns what it was for.

function verifyProxyRequest(options: VerifyProxyOptions): Promise<ProxyRequest>

ProxyRequest

What a verified proxy request was for.

NameTypeDescription
method'GET' | 'POST'
pathstringAfter /apps/&lt;slug&gt;, starting with /. / is your app's root page.
querystringThe query, without its ?. Parse it with new URLSearchParams(query).
shopstringThe hostname the shopper used, one of the shop's own.
pathPrefixstring/apps/&lt;slug&gt;, for building links and form actions back to yourself.
storeIdstring

VerifyProxyOptions

NameTypeDescription
proxyHeaderstring | null | undefinedThe storeware-proxy header, exactly as received.
rawBody?string | ArrayBuffer | Uint8ArrayThe body exactly as received, or empty for a GET. A multipart form may hold bytes that are not text, so pass await request.arrayBuffer().
secretstringThe secret handed to your plugin when a merchant installed it.
signatureHeaderstring | null | undefined
toleranceSeconds?number | undefined
nowSeconds?number | undefined

PROXY_HEADER

The header that carries what Storeware signed.

const PROXY_HEADER: 'storeware-proxy'

On this page