# Interface: RecommendationsNamespace

Defined in: [types.ts:1053](https://github.com/alleyinteractive/allegro/blob/55f164387b71ee5734edbac6a84a466bfef02167/packages/allegro-platform/resources/js/sdk/types.ts#L1053)

Recommendation fetching and click reporting methods, available as `allegro.recommendations`.

## Methods[​](#methods "Direct link to Methods")

### get()[​](#get "Direct link to get()")

> **get**(`options?`): `Promise`<[`RecommendationSet`](/developer/api-reference/interfaces/RecommendationSet.md)>

Defined in: [types.ts:1062](https://github.com/alleyinteractive/allegro/blob/55f164387b71ee5734edbac6a84a466bfef02167/packages/allegro-platform/resources/js/sdk/types.ts#L1062)

Fetch ranked recommendations for this reader.

#### Parameters[​](#parameters "Direct link to Parameters")

| Parameter  | Type                                                                                            |
| ---------- | ----------------------------------------------------------------------------------------------- |
| `options?` | [`RecommendationsGetOptions`](/developer/api-reference/interfaces/RecommendationsGetOptions.md) |

#### Returns[​](#returns "Direct link to Returns")

`Promise`<[`RecommendationSet`](/developer/api-reference/interfaces/RecommendationSet.md)>

#### Example[​](#example "Direct link to Example")

```ts
const { items } = await allegro.recommendations.get({ limit: 6 });

```

***

### trackClick()[​](#trackclick "Direct link to trackClick()")

> **trackClick**(`item`, `options?`): `Promise`<`void`>

Defined in: [types.ts:1082](https://github.com/alleyinteractive/allegro/blob/55f164387b71ee5734edbac6a84a466bfef02167/packages/allegro-platform/resources/js/sdk/types.ts#L1082)

Report that the reader clicked one of the items `get()` returned.

Pass the item object itself — the SDK remembers which request served it, so nothing else is needed. `options.position` is the only field the caller can override — useful when the item was re-rendered or reordered and the caller knows its displayed position better than the SDK's original index; `requestId`, `device`, `sourcePath`, and `strategy` always come from the recorded origin, not from `options`.

#### Parameters[​](#parameters-1 "Direct link to Parameters")

| Parameter           | Type                                                                              |
| ------------------- | --------------------------------------------------------------------------------- |
| `item`              | [`RecommendationItem`](/developer/api-reference/interfaces/RecommendationItem.md) |
| `options?`          | { `position?`: `number`; }                                                        |
| `options.position?` | `number`                                                                          |

#### Returns[​](#returns-1 "Direct link to Returns")

`Promise`<`void`>

#### Throws[​](#throws "Direct link to Throws")

AllegroApiError when the item cannot be traced to a request, or when its path appears in two different result sets on this page.

#### Example[​](#example-1 "Direct link to Example")

```ts
link.addEventListener('click', () => allegro.recommendations.trackClick(item));

```
