[**@wocart/storefront v3.1.0**](../../README)

***

[@wocart/storefront](../../README) / [server](../README) / readPreviewRequest

# Function: readPreviewRequest()

> **readPreviewRequest**(`request`, `options`): `Promise`\<[`PreviewRequest`](../type-aliases/PreviewRequest)\>

Read a preview request. Two kinds, both refused — and nothing rendered —
unless the token verifies for this storefront and theme:

- `GET ?token=…&surface=…[&locale=…][&path=…]`: the editor frames the
  preview. The draft names what to show and carries nothing else, so the
  page renders as saved until the editor sends a draft.
- `POST` JSON `{ token, draft }` from this storefront's own origin: the
  framed page re-rendering a draft. A cross-site form can never post one.

## Parameters

### request

`Request`

### options

[`PreviewRequestOptions`](../interfaces/PreviewRequestOptions)

## Returns

`Promise`\<[`PreviewRequest`](../type-aliases/PreviewRequest)\>
