# tys.recommendation()

> The shopper's recommended size for a product, in your size labels, without mounting anything (a hidden frame on our origin answers).

Source: https://docs.tryyoursize.com/reference/web/client-recommendation/

*Method* · `@tryyoursize/sdk`

The shopper's recommended size for a product, in your size labels, without mounting anything (a hidden frame on our origin answers). Sizes only.

A visitor in the [A/B holdout](https://docs.tryyoursize.com/guides/ab-holdout.md) always gets `unavailable`, so you show them no size either. The call never starts a simulation.

```ts
recommendation(product: string): Promise<Recommendation>;
```

## Parameters

- **`product`** (`string`, required): Your product ID or SKU, as synced to TryYourSize.

## Returns

`Promise<Recommendation>`: The shopper's recommended size for the product.

- **`product`** (`string`, required)
- **`status`** (`RecommendationStatus`, required): `ready` (`size` is set), `computing` (a try-on the shopper started is still running), `none` (no size of this garment can be worn on this body), `signed_out` (no TryYourSize session on your site) or `unavailable` (no size for this product yet).
- **`size`** (`string | null`, required): The recommended size in the store's own label (its size map), or null.
- **`studioSize`** (`string | null`, required): The same size as entered in TryYourSize Studio, or null.
- **`wearableSizes`** (`string[]`, optional): Sizes that can be worn on this body, in the store's labels (when simulated).

## Example

**JavaScript**

```js
const rec = await tys.recommendation("SKU-123");
if (rec.status === "ready") {
  sizePicker.value = rec.size; // "M", in your own labels
}
```

**React**

```tsx

function usePreselect(product: string, select: (size: string) => void) {
  const tys = useTryYourSize();
  useEffect(() => {
    tys?.recommendation(product).then((r) => r.status === "ready" && r.size && select(r.size));
  }, [tys, product]);
}
```

## See also

- [Preselect the recommended size](https://docs.tryyoursize.com/guides/recommendation-event.md)
- ["recommendation" event](https://docs.tryyoursize.com/reference/web/event-recommendation.md)
