> ## Documentation Index
> Fetch the complete documentation index at: https://docs-loja.usecorvex.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# reviews.list / reviews.summary

> Listar avaliações aprovadas e resumo agregado.

# storefront.reviews

O cliente não filtra status. Se a lista só traz avaliações aprovadas, isso é regra da API, não deste mapper.

***

## reviews.list(options)

### Parâmetros

| Campo | Tipo | Default | Descrição |
| - | - | - | - |
| `product` | `ResourceRef` | — | Filtrar por produto (UUID ou handle) |
| `scope` | `'store' \| 'all'` | store | `'all'` → `productId=all` |
| `rating` | `1–5` | — | Filtrar estrela |
| `verified` | `boolean` | — | Compra verificada |
| `first` | `number` | O cliente não define default | Vira `limit` na query. O cliente não impõe máximo 50 |
| `page` | `number` | 1 | Paginação |
| `sort` | `ReviewSort` | `recent` | `recent`, `rating_high`, `rating_low`, `helpful` |

### Retorno

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  reviews: Connection<Review>;
  summary: ReviewsSummary;
}
```

### Exemplo

```js theme={"theme":{"light":"github-light","dark":"github-dark"}}
export const data = defineSectionData(async ({ storefront, page }) => ({
  reviews: await storefront.reviews.list({
    product: page.product,
    first: 10,
    sort: 'recent',
  }),
}));
```

### Hook

```jsx theme={"theme":{"light":"github-light","dark":"github-dark"}}
const { data } = useCorvexData({
  reviews: { product: productId, first: 10 },
});
```

***

## reviews.summary(options)

Média, total, distribuição por estrela.

```js theme={"theme":{"light":"github-light","dark":"github-dark"}}
const reviews_summary = await storefront.reviews.summary({
  product: page.product,
});
```

Use no **layout** da PDP para estrelas no hero (`schema.data` implícito global).

***

## reviews.create(input) — Action

| Campo | Obrigatório |
| - | - |
| `authorName` | ✅ |
| `rating` | ✅ (1–5) |
| `product` | Recomendado na PDP |
| `authorEmail`, `title`, `body`, `orderId` | Opcional |

```js theme={"theme":{"light":"github-light","dark":"github-dark"}}
await storefront.reviews.create({
  product: page.product,
  authorName: 'Maria',
  authorEmail: 'maria@email.com',
  rating: 5,
  body: 'Excelente produto!',
});
```

Rate limit aplicado pelo backend.

***

## Declaração na section

```js theme={"theme":{"light":"github-light","dark":"github-dark"}}
data: ['reviews', 'product']
```

Veja [Mapa de dados → schema.data](https://docs-loja.usecorvex.com.br/data/scope-data-map.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.