Feed Widget (React)
A React component widget that creates a personalized, scrollable feed of item recommendations, designed for continuous content discovery.
Use this library when you want to render a widget and you are using React and JSX in your project.
This widget library is version 0.2.26 and the API can change. Please specify exact version when installing.
Installation
Install @recombee/feed-widget-react@0.2.26 and recombee-js-api-client
packages using your preferred NPM package manager. This example is using
pnpm.
pnpm add @recombee/feed-widget-react@0.2.26 recombee-js-api-client
Always remember to apply the default CSS file distributed alongside the widget library, as shown in the examples.
Client Initialization
The widget loads recommendation data using Recombee API Client. Here is how to initialize the client with necessary configuration for a specific database:
import { class ApiClientClient for sending requests to Recombee and getting replies
ApiClient } from "recombee-js-api-client";
const const DATABASE_ID: "[database-id]"DATABASE_ID = "[database-id]";
const const PUBLIC_TOKEN: "[database-public-token]"PUBLIC_TOKEN = "[database-public-token]";
const const REGION: "[database-region]"REGION = "[database-region]";
export const const apiClient: ApiClientapiClient = new new ApiClient(databaseId: string, publicToken: string, options?: ApiClientOptions): ApiClientApiClient(const DATABASE_ID: "[database-id]"DATABASE_ID, const PUBLIC_TOKEN: "[database-public-token]"PUBLIC_TOKEN, {
region?: string | undefinedregion: const REGION: "[database-region]"REGION,
});
The Database Public Token can be found in the Admin UI Database Settings Page.
The widget also needs to be provided a createRequest function, which
instantiates a client request class to define which data to pull from the
database. Use Scenario ID which can be found on Admin GUI
Database Scenarios Page.
Please ensure that you provide the user ID (typically obtained from your existing user tracking system), along with other relevant parameters - such as an item ID or Item Segment ID - depending on the specific type of recommendation request. See the Providing User ID section for details on how to obtain user ID in specific cases.
import { type type CreateRequestFunction = (options: FetchContentOptions) => RequestFactory for creating Recombee API Request to load data into a Widget.
CreateRequestFunction } from "@recombee/carousel-widget-react";
import { class RecommendItemsToUserBased on the user's past interactions (purchases, ratings, etc.) with the items, recommends top-N items that are most likely to be of high value for the given user.
The most typical use cases are recommendations on the homepage, in some "Picked just for you" section, or in email.
The returned items are sorted by relevance (the first item being the most relevant).
Besides the recommended items, also a unique recommId is returned in the response. It can be used to:
- Let Recombee know that this recommendation was successful (e.g., user clicked one of the recommended items). See Reported metrics.
- Get subsequent recommended items when the user scrolls down (infinite scroll) or goes to the next page. See Recommend Next Items.
It is also possible to use POST HTTP method (for example in the case of a very long ReQL filter) - query parameters then become body parameters.
RecommendItemsToUser } from "recombee-js-api-client";
const const createRequest: CreateRequestFunctioncreateRequest: type CreateRequestFunction = (options: FetchContentOptions) => RequestFactory for creating Recombee API Request to load data into a Widget.
CreateRequestFunction = ({ count: numberNumber of items to fetch for the widget. Pass it to the appropriate
Request constructor.
count }) => {
const const SCENARIO_ID: "recommend-items-to-user"SCENARIO_ID = "recommend-items-to-user";
return new new RecommendItemsToUser(userId: string, count: number, optional?: {
scenario?: string;
cascadeCreate?: boolean;
returnProperties?: boolean;
includedProperties?: string[];
filter?: string;
booster?: string;
logic?: string | object;
reqlExpressions?: Record<string, string>;
diversity?: number;
minRelevance?: string;
rotationRate?: number;
rotationTime?: number;
expertSettings?: Record<string, unknown>;
returnAbGroup?: boolean;
}): RecommendItemsToUser
RecommendItemsToUser(userId, count: numberNumber of items to fetch for the widget. Pass it to the appropriate
Request constructor.
count, {
scenario?: string | undefinedScenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".
scenario: const SCENARIO_ID: "recommend-items-to-user"SCENARIO_ID,
cascadeCreate?: boolean | undefinedIf the user does not exist in the database, returns a list of non-personalized recommendations and creates the user in the database. This allows, for example, rotations in the following recommendations for that user, as the user will be already known to the system.
cascadeCreate: true,
returnProperties?: boolean | undefinedWith returnProperties=true, property values of the recommended items are returned along with their IDs in a JSON dictionary. The acquired property values can be used to easily display the recommended items to the user.
returnProperties: true,
});
};
Providing User ID
Each visitor of your website should be identified by a user identificator
(userId) to correlate user activity and deliver best possible
recommendation performance. The userId should preferrably originate from
your user's account details when the user is authenticated or as some
session-persistent random ID when they are anonymous. The SDK provides
utility which generates random user id and saves it to a cookie to cover the
latter case:
import { type type CreateRequestFunction = (options: FetchContentOptions) => RequestFactory for creating Recombee API Request to load data into a Widget.
CreateRequestFunction } from "@recombee/carousel-widget-react";
import { class RecommendItemsToUserBased on the user's past interactions (purchases, ratings, etc.) with the items, recommends top-N items that are most likely to be of high value for the given user.
The most typical use cases are recommendations on the homepage, in some "Picked just for you" section, or in email.
The returned items are sorted by relevance (the first item being the most relevant).
Besides the recommended items, also a unique recommId is returned in the response. It can be used to:
- Let Recombee know that this recommendation was successful (e.g., user clicked one of the recommended items). See Reported metrics.
- Get subsequent recommended items when the user scrolls down (infinite scroll) or goes to the next page. See Recommend Next Items.
It is also possible to use POST HTTP method (for example in the case of a very long ReQL filter) - query parameters then become body parameters.
RecommendItemsToUser } from "recombee-js-api-client";
import { class PersistentUserIDPersistentUserID } from "@recombee/carousel-widget-react";
let let userId: string | undefineduserId: string | undefined;
if (authenticatedUserId) {
let userId: string | undefineduserId = authenticatedUserId;
} else {
let userId: string | undefineduserId = class PersistentUserIDPersistentUserID.PersistentUserID.getId(): stringgetId();
}
const const createRequest: CreateRequestFunctioncreateRequest: type CreateRequestFunction = (options: FetchContentOptions) => RequestFactory for creating Recombee API Request to load data into a Widget.
CreateRequestFunction = ({ count: numberNumber of items to fetch for the widget. Pass it to the appropriate
Request constructor.
count }) => {
const const SCENARIO_ID: "recommend-items-to-user"SCENARIO_ID = "recommend-items-to-user";
return new new RecommendItemsToUser(userId: string, count: number, optional?: {
scenario?: string;
cascadeCreate?: boolean;
returnProperties?: boolean;
includedProperties?: string[];
filter?: string;
booster?: string;
logic?: string | object;
reqlExpressions?: Record<string, string>;
diversity?: number;
minRelevance?: string;
rotationRate?: number;
rotationTime?: number;
expertSettings?: Record<string, unknown>;
returnAbGroup?: boolean;
}): RecommendItemsToUser
RecommendItemsToUser(let userId: string | undefineduserId, count: numberNumber of items to fetch for the widget. Pass it to the appropriate
Request constructor.
count, {
scenario?: string | undefinedScenario defines a particular application of recommendations. It can be, for example, "homepage", "cart", or "emailing".
scenario: const SCENARIO_ID: "recommend-items-to-user"SCENARIO_ID,
cascadeCreate?: boolean | undefinedIf the user does not exist in the database, returns a list of non-personalized recommendations and creates the user in the database. This allows, for example, rotations in the following recommendations for that user, as the user will be already known to the system.
cascadeCreate: true,
returnProperties?: boolean | undefinedWith returnProperties=true, property values of the recommended items are returned along with their IDs in a JSON dictionary. The acquired property values can be used to easily display the recommended items to the user.
returnProperties: true,
});
};
Basic Example
The widget in this example uses the DefaultItem component to render each recommendation in a consistent layout.
The resulting widget is inserted into the element specified by the
container field.
Values of the recommended items - such as title, image URL, or link URL - are
obtained from the API response and accessed via props.result?.values.
Ensure that returnProperties: true is set in the request, and optionally use includedProperties to control which item properties are returned.
import {
const FeedWidget: React.FunctionComponent<FeedWidgetProps>Feed widget component. See
{@link
FeedWidgetProps
}
for configuration options.
FeedWidget,
const DefaultItem: ((props: DefaultItemProps) => React.JSX.Element) & {
displayName: string;
}
Default Item component provided for basic usage.
DefaultItem,
const ItemImage: React.FunctionComponent<ItemImageProps>Item image component
ItemImage,
function addRecommIdQueryParam(url: string, recommId: string | undefined): string (+1 overload)Utility function to append recombee_recomm_id parameter to an url string.
For usage in widget template to construct item link URL.
addRecommIdQueryParam,
} from "@recombee/feed-widget-react";
import "@recombee/feed-widget-react/dist/styles.css";
export default () => {
return (
<const FeedWidget: React.FunctionComponent<FeedWidgetProps>Feed widget component. See
{@link
FeedWidgetProps
}
for configuration options.
FeedWidget
WidgetConfigurationBase<CreateRequestFunction>.apiClient: ApiClientInstance of Recombee JS API Client. See
{@link
file://./#client-initialization Example
}
.
apiClient={const apiClient: ApiClientapiClient}
WidgetConfigurationBase<CreateRequestFunction>.createRequest: CreateRequestFunctionRequest factory function. See
{@link
file://./#client-initialization Quick Example
}
or visit
{@link
file:///api API Reference
}
for overview of available requests.
createRequest={const createRequest: CreateRequestFunctioncreateRequest}
loadMoreTrigger: "click"loadMoreTrigger="click"
initialRowsCount?: number | undefinedNumber of rows to load initially.
initialRowsCount={1}
loadMoreRowsCount?: number | undefinedNumber of rows to load on "load more" trigger invocation.
loadMoreRowsCount={2}
itemWrapperClassName?: string | undefinedCustom classes of item wrapper element. See
{@link
file://./#custom-css Custom CSS
}
.
itemWrapperClassName="min-h-[260px]"
type ItemComponent: React.FC<{
state: FeedWidgetState;
result: Recommendation;
}>
A component rendering a single recommended item.
ItemComponent={(props: {
state: FeedWidgetState;
result: Recommendation;
}
props) => (
<const DefaultItem: ((props: DefaultItemProps) => React.JSX.Element) & {
displayName: string;
}
Default Item component provided for basic usage.
DefaultItem
DefaultItemProps.href?: string | null | undefinedItem link URL.
href={function addRecommIdQueryParam(url: string, recommId: string | undefined): string (+1 overload)Utility function to append recombee_recomm_id parameter to an url string.
For usage in widget template to construct item link URL.
addRecommIdQueryParam(
props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.link,
props: {
state: FeedWidgetState;
result: Recommendation;
}
props.state: FeedWidgetStatestate.FeedWidgetState.recommId: string | undefinedId of recommendation response from which the items originated.
recommId,
)}
DefaultItemProps.image?: React.ReactNodeItem Image element.
image={
<const ItemImage: React.FunctionComponent<ItemImageProps>Item image component
ItemImage
src?: string | null | undefinedImage URL
src={`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.images?.[0]}`}
width?: number | undefinedImage width in pixels
width={600}
height?: number | undefinedImage height in pixels
height={400}
/>
}
DefaultItemProps.labelContent?: React.ReactNodeItem content above title. Sets the entire content of an item aside from
an image.
labelContent={`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.genres?.join(", ")}`}
DefaultItemProps.title?: React.ReactNodeItem title.
title={`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.title}`}
DefaultItemProps.highlightedContent?: React.ReactNodeItem content under title. Sets the entire content of an item aside from
an image.
highlightedContent={`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.year}`}
/>
)}
type LoadMoreTriggerComponent: React.FC<{
state: FeedWidgetState;
}> & React.FC<{
state: FeedWidgetState;
}>
LoadMoreTriggerComponent={(props: {
state: FeedWidgetState;
}
props) => (
<React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div React.HTMLAttributes<HTMLDivElement>.className?: string | undefinedclassName="flex justify-center p-2">
<React.JSX.IntrinsicElements.button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>button
React.HTMLAttributes<T>.className?: string | undefinedclassName="me-2 mb-2 rounded-lg bg-[#3f91ff] px-5 py-2.5 text-sm font-medium text-white focus:ring-4 focus:ring-blue-300 focus:outline-hidden"
React.DOMAttributes<HTMLButtonElement>.onClick?: React.MouseEventHandler<HTMLButtonElement> | undefinedonClick={props: {
state: FeedWidgetState;
}
props.state: FeedWidgetStatestate.FeedWidgetState.handleTriggerClick(): voidHandles clicking on a trigger to load more feed items by a configured
increment
handleTriggerClick}
>
More
</React.JSX.IntrinsicElements.button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>button>
</React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div>
)}
/>
);
};
Custom CSS
Recombee Widgets are designed to be styling-agnostic. You can fully customize their appearance using your own CSS by passing class names through customization properties.
In these docs examples, we use utility classes from Tailwind CSS for styling.
Class names for internal elements and custom components are passed as props and applied by the widget during rendering. The default structure of the Basic Example widget is illustrated below (pseudo-code):
<div class="{className}">
<div class="{contentClassName}">
<div class="{itemWrapperClassName}">
<ItemComponent />
</div>
<div class="{itemWrapperClassName}">
<ItemComponent />
</div>
<div class="{itemWrapperClassName}">
<ItemComponent />
</div>
... more items ...
</div>
<LoadMoreTriggerComponent />
</div>
This is especially handy for understanding how to customize the widget to its full potential.
Setting own classes
import {
const FeedWidget: React.FunctionComponent<FeedWidgetProps>Feed widget component. See
{@link
FeedWidgetProps
}
for configuration options.
FeedWidget,
const DefaultItem: ((props: DefaultItemProps) => React.JSX.Element) & {
displayName: string;
}
Default Item component provided for basic usage.
DefaultItem,
const ItemImage: React.FunctionComponent<ItemImageProps>Item image component
ItemImage,
function addRecommIdQueryParam(url: string, recommId: string | undefined): string (+1 overload)Utility function to append recombee_recomm_id parameter to an url string.
For usage in widget template to construct item link URL.
addRecommIdQueryParam,
} from "@recombee/feed-widget-react";
import "@recombee/feed-widget-react/dist/styles.css";
export default () => {
return (
<const FeedWidget: React.FunctionComponent<FeedWidgetProps>Feed widget component. See
{@link
FeedWidgetProps
}
for configuration options.
FeedWidget
WidgetConfigurationBase<CreateRequestFunction>.apiClient: ApiClientInstance of Recombee JS API Client. See
{@link
file://./#client-initialization Example
}
.
apiClient={const apiClient: ApiClientapiClient}
WidgetConfigurationBase<CreateRequestFunction>.createRequest: CreateRequestFunctionRequest factory function. See
{@link
file://./#client-initialization Quick Example
}
or visit
{@link
file:///api API Reference
}
for overview of available requests.
createRequest={const createRequest: CreateRequestFunctioncreateRequest}
loadMoreTrigger: "click"loadMoreTrigger="click"
contentClassName?: string | undefinedCustom classes of content wrapper element. See
{@link
file://./#custom-css Custom CSS
}
.
contentClassName="grid-cols-[repeat(auto-fill,minmax(200px,1fr))] p-3 gap-2 overflow-hidden text-[#282b30] rounded-lg bg-white border border-[#ededed] dark:border-none dark:bg-transparent dark:text-white"
itemWrapperClassName?: string | undefinedCustom classes of item wrapper element. See
{@link
file://./#custom-css Custom CSS
}
.
itemWrapperClassName="min-h-[260px]"
type ItemComponent: React.FC<{
state: FeedWidgetState;
result: Recommendation;
}>
A component rendering a single recommended item.
ItemComponent={(props: {
state: FeedWidgetState;
result: Recommendation;
}
props) => (
<const DefaultItem: ((props: DefaultItemProps) => React.JSX.Element) & {
displayName: string;
}
Default Item component provided for basic usage.
DefaultItem
DefaultItemProps.className?: string | undefinedCustom classes of item wrapper element. See
{@link
file://./#custom-css Custom CSS
}
.
className="border-b border-slate-600"
DefaultItemProps.contentWrapperClassName?: string | undefinedCustom classes of item content element. See
{@link
file://./#custom-css Custom CSS
}
.
contentWrapperClassName="text-center"
DefaultItemProps.href?: string | null | undefinedItem link URL.
href={function addRecommIdQueryParam(url: string, recommId: string | undefined): string (+1 overload)Utility function to append recombee_recomm_id parameter to an url string.
For usage in widget template to construct item link URL.
addRecommIdQueryParam(
props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.link,
props: {
state: FeedWidgetState;
result: Recommendation;
}
props.state: FeedWidgetStatestate.FeedWidgetState.recommId: string | undefinedId of recommendation response from which the items originated.
recommId,
)}
DefaultItemProps.image?: React.ReactNodeItem Image element.
image={
<const ItemImage: React.FunctionComponent<ItemImageProps>Item image component
ItemImage
src?: string | null | undefinedImage URL
src={`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.images?.[0]}`}
width?: number | undefinedImage width in pixels
width={600}
height?: number | undefinedImage height in pixels
height={400}
/>
}
DefaultItemProps.labelContent?: React.ReactNodeItem content above title. Sets the entire content of an item aside from
an image.
labelContent={`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.genres?.join(", ")}`}
DefaultItemProps.title?: React.ReactNodeItem title.
title={`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.title}`}
DefaultItemProps.highlightedContent?: React.ReactNodeItem content under title. Sets the entire content of an item aside from
an image.
highlightedContent={`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.year}`}
/>
)}
type LoadMoreTriggerComponent: React.FC<{
state: FeedWidgetState;
}> & React.FC<{
state: FeedWidgetState;
}>
LoadMoreTriggerComponent={(props: {
state: FeedWidgetState;
}
props) => (
<React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div React.HTMLAttributes<HTMLDivElement>.className?: string | undefinedclassName="flex justify-center p-2">
<React.JSX.IntrinsicElements.button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>button
React.HTMLAttributes<T>.className?: string | undefinedclassName="me-2 mb-2 rounded-lg bg-[#3f91ff] px-5 py-2.5 text-sm font-medium text-white focus:ring-4 focus:ring-blue-300 focus:outline-hidden"
React.DOMAttributes<HTMLButtonElement>.onClick?: React.MouseEventHandler<HTMLButtonElement> | undefinedonClick={props: {
state: FeedWidgetState;
}
props.state: FeedWidgetStatestate.FeedWidgetState.handleTriggerClick(): voidHandles clicking on a trigger to load more feed items by a configured
increment
handleTriggerClick}
>
More
</React.JSX.IntrinsicElements.button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>button>
</React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div>
)}
/>
);
};
Custom Templates
Recombee Widgets support full customization of internal components such as the appearance of the recommended items.
You can provide your own components via props like ItemComponent to control the structure, styling, and behavior of the widget.
This flexibility allows you to adapt the widget's appearance and functionality to match your design and user experience requirements.
Custom Item
import { const FeedWidget: React.FunctionComponent<FeedWidgetProps>Feed widget component. See
{@link
FeedWidgetProps
}
for configuration options.
FeedWidget, const ItemImage: React.FunctionComponent<ItemImageProps>Item image component
ItemImage } from "@recombee/feed-widget-react";
import "@recombee/feed-widget-react/dist/styles.css";
export default () => {
return (
<const FeedWidget: React.FunctionComponent<FeedWidgetProps>Feed widget component. See
{@link
FeedWidgetProps
}
for configuration options.
FeedWidget
WidgetConfigurationBase<CreateRequestFunction>.apiClient: ApiClientInstance of Recombee JS API Client. See
{@link
file://./#client-initialization Example
}
.
apiClient={const apiClient: ApiClientapiClient}
WidgetConfigurationBase<CreateRequestFunction>.createRequest: CreateRequestFunctionRequest factory function. See
{@link
file://./#client-initialization Quick Example
}
or visit
{@link
file:///api API Reference
}
for overview of available requests.
createRequest={const createRequest: CreateRequestFunctioncreateRequest}
loadMoreTrigger: "click"loadMoreTrigger="click"
itemWrapperClassName?: string | undefinedCustom classes of item wrapper element. See
{@link
file://./#custom-css Custom CSS
}
.
itemWrapperClassName="min-h-[310px]"
type ItemComponent: React.FC<{
state: FeedWidgetState;
result: Recommendation;
}>
A component rendering a single recommended item.
ItemComponent={(props: {
state: FeedWidgetState;
result: Recommendation;
}
props) => (
<React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div React.HTMLAttributes<HTMLDivElement>.className?: string | undefinedclassName="overflow-hidden rounded-lg border-[#ededed] bg-white text-[#282b30] dark:border-none dark:bg-transparent dark:text-white">
<React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div React.HTMLAttributes<HTMLDivElement>.className?: string | undefinedclassName="relative overflow-hidden bg-cover bg-no-repeat">
<const ItemImage: React.FunctionComponent<ItemImageProps>Item image component
ItemImage
src?: string | null | undefinedImage URL
src={`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.images?.[0]}`}
width?: number | undefinedImage width in pixels
width={600}
height?: number | undefinedImage height in pixels
height={400}
/>
{props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.["genres"]?.includes("drama") && (
<React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div React.HTMLAttributes<HTMLDivElement>.className?: string | undefinedclassName="absolute top-3 left-3 bg-[#3f91ff] px-2 text-xs/[1.67] font-semibold text-white">
Drama
</React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div>
)}
{props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.["genres"]?.includes("science_fiction") && (
<React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div React.HTMLAttributes<HTMLDivElement>.className?: string | undefinedclassName="absolute top-3 left-3 bg-[#36c696] px-2 text-xs/[1.67] font-semibold text-white">
Sci-Fi
</React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div>
)}
</React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div>
<React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div React.HTMLAttributes<HTMLDivElement>.className?: string | undefinedclassName="p-3">
<React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div React.HTMLAttributes<HTMLDivElement>.className?: string | undefinedclassName="mb-1 line-clamp-4 overflow-hidden text-[14px]/[1.43] text-nowrap text-ellipsis text-[#80868f]">
{`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.genres?.join(", ")}`}
</React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div>
<React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div React.HTMLAttributes<HTMLDivElement>.className?: string | undefinedclassName="text-md mb-1 overflow-hidden text-nowrap text-ellipsis">
{`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.title}`}
</React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div>
<React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div React.HTMLAttributes<HTMLDivElement>.className?: string | undefinedclassName="line-clamp-4 pb-3 text-base text-[#3f91ff]">
{`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.year}`}
</React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div>
<React.JSX.IntrinsicElements.button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>button React.HTMLAttributes<T>.className?: string | undefinedclassName="w-full rounded-lg border border-[#ededed] py-2 text-center text-[14px]/[1.43] font-medium text-[#80868f]">
Play
</React.JSX.IntrinsicElements.button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>button>
</React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div>
</React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div>
)}
type LoadMoreTriggerComponent: React.FC<{
state: FeedWidgetState;
}> & React.FC<{
state: FeedWidgetState;
}>
LoadMoreTriggerComponent={(props: {
state: FeedWidgetState;
}
props) => (
<React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div React.HTMLAttributes<HTMLDivElement>.className?: string | undefinedclassName="flex justify-center p-2">
<React.JSX.IntrinsicElements.button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>button
React.HTMLAttributes<T>.className?: string | undefinedclassName="me-2 mb-2 rounded-lg bg-[#3f91ff] px-5 py-2.5 text-sm font-medium text-white focus:ring-4 focus:ring-blue-300 focus:outline-hidden"
React.DOMAttributes<HTMLButtonElement>.onClick?: React.MouseEventHandler<HTMLButtonElement> | undefinedonClick={props: {
state: FeedWidgetState;
}
props.state: FeedWidgetStatestate.FeedWidgetState.handleTriggerClick(): voidHandles clicking on a trigger to load more feed items by a configured
increment
handleTriggerClick}
>
More
</React.JSX.IntrinsicElements.button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>button>
</React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div>
)}
/>
);
};
Overriding Base Classes
Some base styles are always applied to ensure the widget maintains the structural shape of a feed.
However, these can be disabled or overridden if needed. Use the FeedWidgetProps.classNameDisableDefault and related options to opt out of default styling.
import {
const FeedWidget: React.FunctionComponent<FeedWidgetProps>Feed widget component. See
{@link
FeedWidgetProps
}
for configuration options.
FeedWidget,
const DefaultItem: ((props: DefaultItemProps) => React.JSX.Element) & {
displayName: string;
}
Default Item component provided for basic usage.
DefaultItem,
const ItemImage: React.FunctionComponent<ItemImageProps>Item image component
ItemImage,
function addRecommIdQueryParam(url: string, recommId: string | undefined): string (+1 overload)Utility function to append recombee_recomm_id parameter to an url string.
For usage in widget template to construct item link URL.
addRecommIdQueryParam,
} from "@recombee/feed-widget-react";
import "@recombee/feed-widget-react/dist/styles.css";
export default () => {
return (
<const FeedWidget: React.FunctionComponent<FeedWidgetProps>Feed widget component. See
{@link
FeedWidgetProps
}
for configuration options.
FeedWidget
WidgetConfigurationBase<CreateRequestFunction>.apiClient: ApiClientInstance of Recombee JS API Client. See
{@link
file://./#client-initialization Example
}
.
apiClient={const apiClient: ApiClientapiClient}
WidgetConfigurationBase<CreateRequestFunction>.createRequest: CreateRequestFunctionRequest factory function. See
{@link
file://./#client-initialization Quick Example
}
or visit
{@link
file:///api API Reference
}
for overview of available requests.
createRequest={const createRequest: CreateRequestFunctioncreateRequest}
loadMoreTrigger: "click"loadMoreTrigger="click"
loadMoreRowsCount?: number | undefinedNumber of rows to load on "load more" trigger invocation.
loadMoreRowsCount={2}
itemWrapperClassName?: string | undefinedCustom classes of item wrapper element. See
{@link
file://./#custom-css Custom CSS
}
.
itemWrapperClassName="min-h-[260px]"
type ItemComponent: React.FC<{
state: FeedWidgetState;
result: Recommendation;
}>
A component rendering a single recommended item.
ItemComponent={(props: {
state: FeedWidgetState;
result: Recommendation;
}
props) => (
<const DefaultItem: ((props: DefaultItemProps) => React.JSX.Element) & {
displayName: string;
}
Default Item component provided for basic usage.
DefaultItem
DefaultItemProps.href?: string | null | undefinedItem link URL.
href={function addRecommIdQueryParam(url: string, recommId: string | undefined): string (+1 overload)Utility function to append recombee_recomm_id parameter to an url string.
For usage in widget template to construct item link URL.
addRecommIdQueryParam(
props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.link,
props: {
state: FeedWidgetState;
result: Recommendation;
}
props.state: FeedWidgetStatestate.FeedWidgetState.recommId: string | undefinedId of recommendation response from which the items originated.
recommId,
)}
DefaultItemProps.image?: React.ReactNodeItem Image element.
image={
<const ItemImage: React.FunctionComponent<ItemImageProps>Item image component
ItemImage
src?: string | null | undefinedImage URL
src={`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.images?.[0]}`}
width?: number | undefinedImage width in pixels
width={600}
height?: number | undefinedImage height in pixels
height={400}
/>
}
DefaultItemProps.labelContent?: React.ReactNodeItem content above title. Sets the entire content of an item aside from
an image.
labelContent={`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.genres?.join(", ")}`}
DefaultItemProps.title?: React.ReactNodeItem title.
title={`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.title}`}
DefaultItemProps.highlightedContent?: React.ReactNodeItem content under title. Sets the entire content of an item aside from
an image.
highlightedContent={`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.year}`}
/>
)}
type LoadMoreTriggerComponent: React.FC<{
state: FeedWidgetState;
}> & React.FC<{
state: FeedWidgetState;
}>
LoadMoreTriggerComponent={(props: {
state: FeedWidgetState;
}
props) => (
<React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div React.HTMLAttributes<HTMLDivElement>.className?: string | undefinedclassName="flex justify-center p-2">
<React.JSX.IntrinsicElements.button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>button
React.HTMLAttributes<T>.className?: string | undefinedclassName="me-2 mb-2 rounded-lg bg-[#3f91ff] px-5 py-2.5 text-sm font-medium text-white focus:ring-4 focus:ring-blue-300 focus:outline-hidden"
React.DOMAttributes<HTMLButtonElement>.onClick?: React.MouseEventHandler<HTMLButtonElement> | undefinedonClick={props: {
state: FeedWidgetState;
}
props.state: FeedWidgetStatestate.FeedWidgetState.handleTriggerClick(): voidHandles clicking on a trigger to load more feed items by a configured
increment
handleTriggerClick}
>
More
</React.JSX.IntrinsicElements.button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>button>
</React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div>
)}
/>
);
};
Composite Recommendations
Widget SDKs can also be used to render Composite Recommendations. A common use case is displaying dynamic category- or genre-based rails on the homepage, as well as scenarios such as Because You Watched. The CompositeRecommendation request is called from within the createRequest function. To render the header (for example, the user’s favorite category or the title of the watched movie), implement the SourceItemComponent.
const const createRequest: CreateRequestFunctioncreateRequest: type CreateRequestFunction = (options: FetchContentOptions) => RequestFactory for creating Recombee API Request to load data into a Widget.
CreateRequestFunction = ({ count: numberNumber of items to fetch for the widget. Pass it to the appropriate
Request constructor.
count }) => {
return new new CompositeRecommendation(scenario: string, count: number, optional?: {
itemId?: string;
userId?: string;
logic?: string | object;
segmentId?: string;
cascadeCreate?: boolean;
sourceSettings?: Record<string, unknown>;
resultSettings?: Record<string, unknown>;
expertSettings?: Record<string, unknown>;
}): CompositeRecommendation
CompositeRecommendation("top-from-genre-for-you", count: numberNumber of items to fetch for the widget. Pass it to the appropriate
Request constructor.
count, {
resultSettings?: Record<string, unknown> | undefinedParameters applied for recommending the Result stage. The accepted parameters correspond with the recommendation sub-endpoint used to recommend the Result.
resultSettings: { returnProperties: booleanreturnProperties: true },
});
};
import {
const FeedWidget: React.FunctionComponent<FeedWidgetProps>Feed widget component. See
{@link
FeedWidgetProps
}
for configuration options.
FeedWidget,
const DefaultItem: ((props: DefaultItemProps) => React.JSX.Element) & {
displayName: string;
}
Default Item component provided for basic usage.
DefaultItem,
const ItemImage: React.FunctionComponent<ItemImageProps>Item image component
ItemImage,
function addRecommIdQueryParam(url: string, recommId: string | undefined): string (+1 overload)Utility function to append recombee_recomm_id parameter to an url string.
For usage in widget template to construct item link URL.
addRecommIdQueryParam,
} from "@recombee/feed-widget-react";
import "@recombee/feed-widget-react/dist/styles.css";
export default () => {
return (
<const FeedWidget: React.FunctionComponent<FeedWidgetProps>Feed widget component. See
{@link
FeedWidgetProps
}
for configuration options.
FeedWidget
WidgetConfigurationBase<CreateRequestFunction>.apiClient: ApiClientInstance of Recombee JS API Client. See
{@link
file://./#client-initialization Example
}
.
apiClient={const apiClient: ApiClientapiClient}
WidgetConfigurationBase<CreateRequestFunction>.createRequest: CreateRequestFunctionRequest factory function. See
{@link
file://./#client-initialization Quick Example
}
or visit
{@link
file:///api API Reference
}
for overview of available requests.
createRequest={const createRequest: CreateRequestFunctioncreateRequest}
loadMoreTrigger: "click"loadMoreTrigger="click"
initialRowsCount?: number | undefinedNumber of rows to load initially.
initialRowsCount={1}
loadMoreRowsCount?: number | undefinedNumber of rows to load on "load more" trigger invocation.
loadMoreRowsCount={2}
itemWrapperClassName?: string | undefinedCustom classes of item wrapper element. See
{@link
file://./#custom-css Custom CSS
}
.
itemWrapperClassName="min-h-[260px]"
SourceItemComponent?: React.FC<{
state: FeedWidgetState;
source?: Recommendation | null;
}> | undefined
A component rendering a source recommended item when using Composite
Scenario.
SourceItemComponent={({ source: Recommendation | null | undefinedsource }) => {
return source: Recommendation | null | undefinedsource ? (
<React.JSX.IntrinsicElements.h1: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>h1 React.HTMLAttributes<HTMLHeadingElement>.className?: string | undefinedclassName="my-5">Because you like {source: Recommendationsource?.id: stringItem ID
id}</React.JSX.IntrinsicElements.h1: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>h1>
) : null;
}}
type ItemComponent: React.FC<{
state: FeedWidgetState;
result: Recommendation;
}>
A component rendering a single recommended item.
ItemComponent={(props: {
state: FeedWidgetState;
result: Recommendation;
}
props) => (
<const DefaultItem: ((props: DefaultItemProps) => React.JSX.Element) & {
displayName: string;
}
Default Item component provided for basic usage.
DefaultItem
DefaultItemProps.href?: string | null | undefinedItem link URL.
href={function addRecommIdQueryParam(url: string, recommId: string | undefined): string (+1 overload)Utility function to append recombee_recomm_id parameter to an url string.
For usage in widget template to construct item link URL.
addRecommIdQueryParam(
props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.link,
props: {
state: FeedWidgetState;
result: Recommendation;
}
props.state: FeedWidgetStatestate.FeedWidgetState.recommId: string | undefinedId of recommendation response from which the items originated.
recommId,
)}
DefaultItemProps.image?: React.ReactNodeItem Image element.
image={
<const ItemImage: React.FunctionComponent<ItemImageProps>Item image component
ItemImage
src?: string | null | undefinedImage URL
src={`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.images?.[0]}`}
width?: number | undefinedImage width in pixels
width={600}
height?: number | undefinedImage height in pixels
height={400}
/>
}
DefaultItemProps.labelContent?: React.ReactNodeItem content above title. Sets the entire content of an item aside from
an image.
labelContent={`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.genres?.join(", ")}`}
DefaultItemProps.title?: React.ReactNodeItem title.
title={`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.title}`}
DefaultItemProps.highlightedContent?: React.ReactNodeItem content under title. Sets the entire content of an item aside from
an image.
highlightedContent={`${props: {
state: FeedWidgetState;
result: Recommendation;
}
props.result: Recommendationresult?.values?: {
[key: string]: any;
} | undefined
Item properties
values?.year}`}
/>
)}
type LoadMoreTriggerComponent: React.FC<{
state: FeedWidgetState;
}> & React.FC<{
state: FeedWidgetState;
}>
LoadMoreTriggerComponent={(props: {
state: FeedWidgetState;
}
props) => (
<React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div React.HTMLAttributes<T>.className?: string | undefinedclassName="flex justify-center p-2">
<React.JSX.IntrinsicElements.button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>button
React.HTMLAttributes<T>.className?: string | undefinedclassName="me-2 mb-2 rounded-lg bg-[#3f91ff] px-5 py-2.5 text-sm font-medium text-white focus:ring-4 focus:ring-blue-300 focus:outline-hidden"
React.DOMAttributes<HTMLButtonElement>.onClick?: React.MouseEventHandler<HTMLButtonElement> | undefinedonClick={props: {
state: FeedWidgetState;
}
props.state: FeedWidgetStatestate.FeedWidgetState.handleTriggerClick(): voidHandles clicking on a trigger to load more feed items by a configured
increment
handleTriggerClick}
>
More
</React.JSX.IntrinsicElements.button: React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>button>
</React.JSX.IntrinsicElements.div: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>div>
)}
/>
);
};
API Reference
FeedWidget
Feed widget component. See FeedWidgetProps for configuration options.
FeedWidgetProps
Configuration options for the Feed widget.
Properties
createRequest
Request factory function. See Quick Example or visit API Reference for overview of available requests.
onRecommResponse
Callback function allowing to intercept and inspect recommendation request+response made by widget.
import React from "react";
import { const CarouselWidget: React.FunctionComponent<CarouselWidgetProps>Carousel widget React Component. See
{@link
CarouselWidgetProps
}
for
configuration options.
CarouselWidget } from "@recombee/carousel-widget-react";
<const CarouselWidget: React.FunctionComponent<CarouselWidgetProps>Carousel widget React Component. See
{@link
CarouselWidgetProps
}
for
configuration options.
CarouselWidget
// ...ommited code...
WidgetConfigurationBase<CreateRequestFunction>.onRecommResponse?: WidgetRecommResponseCallback | undefinedCallback function allowing to intercept and inspect recommendation
request+response made by widget.
import React from "react";
import { CarouselWidget } from "@recombee/carousel-widget-react";
//
onRecommResponse={({ recombeeRequest: RequestrecombeeRequest, recombeeResponse: anyrecombeeResponse }) => {
// use data from request and response for any purpose, i.e. internal tracking
}}
/>;
deduplicationPartitionKey
A string key specifying a group of widgets, in which recommendation results will be deduplicated. By default, all widgets belong to a single group so all results from the same database are deduplicated.
initialRowsCount
Number of rows to load initially.
loadMoreRowsCount
Number of rows to load on "load more" trigger invocation.
loadMoreTrigger
classNameDisableDefault
Disables default classes of widget wrapper element.
There are some default class names with essential styles applied to the widget wrapper element. This setting disables them as an escape hatch for customization. See Custom CSS.
contentClassNameDisableDefault
Disables default classes of content wrapper element.
There are some default class names with essential styles applied to the content wrapper element. This setting disables them as an escape hatch for customization. See Custom CSS.
itemWrapperClassNameDisableDefault
Disables default classes of item wrapper element.
There are some default class names with essential styles applied to the item wrapper element. This setting disables them as an escape hatch for customization. See Custom CSS.
ItemComponent
A component rendering a single recommended item.
LoadMoreTriggerComponent
SourceItemComponent
A component rendering a source recommended item when using Composite Scenario.
FeedWidgetState
A Class exposing Feed internal state to be used for customization.
Properties
sourceItem
Array of items to show in the carousel.
items
Array of items to show in the feed
recommId
Id of recommendation response from which the items originated.
handleTriggerClick
Handles clicking on a trigger to load more feed items by a configured increment
DefaultItem
Default Item component provided for basic usage.
DefaultItemProps
Recommended item component properties.
Properties
classNameDisableBase
Disables default classes of item wrapper element.
There are some default class names with essential styles applied to the item wrapper element. This setting disables them as an escape hatch for customization. See Custom CSS.
imageWrapperClassName
Custom classes of item image wrapper element. See Custom CSS.
imageWrapperClassNameDisableBase
Disables default classes of item image wrapper element.
There are some default class names with essential styles applied to the item image wrapper element. This setting disables them as an escape hatch for customization. See Custom CSS.
result
A single item recommedation.
href
Item link URL.
image
Item Image element.
labelContent
Item content above title. Sets the entire content of an item aside from an image.
labelContentWrapperClassName
Custom classes of label content wrapper element. See Custom CSS.
labelContentWrapperClassNameDisableBase
Disables default classes of label content wrapper element.
There are some default class names with essential styles applied to the label content wrapper element. This setting disables them as an escape hatch for customization. See Custom CSS.
title
Item title.
titleWrapperClassNameDisableBase
Disables default classes of title wrapper element.
There are some default class names with essential styles applied to the title wrapper element. This setting disables them as an escape hatch for customization. See Custom CSS.
highlightedContent
Item content under title. Sets the entire content of an item aside from an image.
highlightedContentWrapperClassName
Custom classes of highlighted content wrapper element. See Custom CSS.
highlightedContentWrapperClassNameDisableBase
Disables default classes of highlighted content wrapper element.
There are some default class names with essential styles applied to the highlighted content wrapper element. This setting disables them as an escape hatch for customization. See Custom CSS.
bottomContent
Any custom content to display at the bottom of the item.
ItemImage
Item image component
ItemImageProps
Item Image properties
Properties
src
Image URL
missingImageSrc
URL of an image to display when the main image could not be loaded.
className
Image wrapper class name
imgClassName
Image class name
width
Image width in pixels
height
Image height in pixels
verticalAlignment
Image vertical alignment
horizontalAlignment
Image horizontal alignment
fittingAlgorithm
Image fitting algorithm
Recommendation
Single recommendation item
Properties
id
Item ID
values
Item properties
addRecommIdQueryParam
Utility function to append recombee_recomm_id parameter to an url string.
For usage in widget template to construct item link URL.
CreateRequestFunction
Factory for creating Recombee API Request to load data into a Widget.
FetchContentOptions
CreateRequestFunction parameter
Properties
count
Number of items to fetch for the widget. Pass it to the appropriate Request constructor.