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

# Reviews

# Reviews

The SDK provides product review functionality — fetching reviews, submitting new reviews, and marking reviews as helpful.

## Usage

```tsx theme={null}
import { useReviews } from 'react-native-stackfront-sdk';
import { FlashList } from '@shopify/flash-list';

function ProductReviews({ productId }: { productId: string }) {
  const { reviews, loading, submitReview, markHelpful } = useReviews(productId);

  if (loading && !reviews) return <Loading />;

  const items = reviews?.data ?? [];

  return (
    <FlashList
      data={items}
      renderItem={({ item }) => (
        <ReviewCard
          review={item}
          onHelpful={() => markHelpful(item.id)}
        />
      )}
      estimatedItemSize={100}
    />
  );
}
```

## Hook API

```ts theme={null}
function useReviews(productId: string): {
  reviews: ProductReviewsSdkResponse | null;
  loading: boolean;
  error: Error | null;
  refetch: () => Promise<void>;
  submitReview: (input: Omit<CreateProductReviewRequest, 'productId'>) => Promise<void>;
  markHelpful: (reviewId: string) => Promise<void>;
}
```

## Submitting a Review

```tsx theme={null}
const { submitReview } = useReviews(productId);

await submitReview({
  rating: 5,
  title: 'Great product!',
  body: 'Really loved this item.',
  authorName: 'Jane D.',
  authorEmail: 'jane@example.com',
});
```

The `productId` from the hook is automatically included in the submission.

## Service API

```ts theme={null}
const { reviews } = useStackfront();

await reviews.getProductReviews(productId, page, pageSize);
await reviews.submitReview({ productId, rating, title, body, authorName, authorEmail });
await reviews.markHelpful(reviewId, { oneSignalPlayerId });
```
