UNPKG

admesh-ui-sdk

Version:

Beautiful, modern React components for displaying AI-powered product recommendations with citation-based conversation ads, auto-triggered widgets, floating chat, conversational interfaces, persistent sidebar, and built-in tracking. Includes zero-code SDK

41 lines 1.25 kB
/** * Hook to access AdMesh SDK and tracking state * * Must be used within an <AdMeshProvider> * * @returns Object with SDK instance and tracking methods * * @example * ```tsx * const { sdk, sessionId, markMessageAsProcessed } = useAdMesh(); * * // Use SDK to show recommendations * await sdk?.showRecommendations({ * query: 'user query', * containerId: 'recommendations-container', * session_id: sessionId, * message_id: messageId * }); * * // Mark message as processed to avoid duplicates * markMessageAsProcessed(messageId); * ``` */ export declare function useAdMesh(): { /** AdMesh SDK instance */ sdk: import('..').AdMeshSDK | null; /** API key */ apiKey: string; /** Session ID */ sessionId: string; /** Theme configuration */ theme: import('..').AdMeshTheme | undefined; /** Set of processed message IDs (for deduplication) */ processedMessageIds: Set<string>; /** Mark a message as processed to prevent duplicate recommendations */ markMessageAsProcessed: (messageId: string) => void; /** Check if a message has already been processed */ isMessageProcessed: (messageId: string) => boolean; }; export default useAdMesh; //# sourceMappingURL=useAdMesh.d.ts.map