@rebuy/hydrogen-sdk
Version:
The React/Hydrogen wrapper for the Rebuy Core SDK.
42 lines (41 loc) • 1.56 kB
TypeScript
import { type RebuySDK } from '@rebuy/core-sdk';
type RebuyProductViewProps = {
/**
* Customer ID if user is logged in (optional)
*/
customerId?: string;
/**
* Product object containing id and handle
*/
product: {
/** Product handle/slug for URL */
handle: string;
/** Shopify GraphQL product ID (e.g., "gid://shopify/Product/123456") */
id: string;
/** Product price (optional) */
price?: {
amount: string;
currencyCode: string;
};
/** Product title (optional) */
title?: string;
};
/**
* Custom rebuy SDK instance (optional)
*/
rebuy?: RebuySDK;
};
/**
* RebuyProductView component tracks product view events for Recently Viewed functionality.
* This component renders nothing visible - it only handles tracking when mounted.
*
* Place this component on product pages to track when users view products.
* The tracked data will be available in the RecentlyViewed component.
*
* @param {RebuyProductViewProps} props - Component props
* @param {object} props.product - Product object with id, handle, and optional price/title
* @param {string} props.customerId - Optional customer ID if user is logged in
* @param {RebuySDK} props.rebuy - Optional custom Rebuy SDK instance (uses context if not provided)
*/
export declare const RebuyProductView: ({ customerId, product, rebuy: customRebuy }: RebuyProductViewProps) => null;
export {};