import type { AbTestAssignment } from '../types'; /** * An A/B test assignment with its test ID included. */ export interface ActiveAbTestAssignment extends AbTestAssignment { /** Contentful entry ID of the PageTest */ testId: string; } /** * Options for the useAbTestAssignments hook. */ export interface UseAbTestAssignmentsOptions { /** * Cookie name to read assignments from. * @default "ab-test-info" */ cookieName?: string; } /** * Hook that returns A/B test assignments for the current page. * * This hook reads the A/B test cookie and returns only the assignments * that match the current page path. Projects can use this to build * their own analytics reporting with project-specific integrations. * * @param options - Hook configuration options * @returns Array of active test assignments for the current page * * @example Basic usage * ```tsx * 'use client'; * * import { useEffect } from 'react'; * import { useAbTestAssignments } from '@se-studio/ab-testing'; * * export function AbTestReporter() { * const assignments = useAbTestAssignments(); * * useEffect(() => { * for (const assignment of assignments) { * // Send to your analytics * sendEvent('experiment_impression', { * experiment_id: assignment.testId, * experiment_name: assignment.experiment_name, * variant_id: assignment.variant_id, * variant_slug: assignment.variant_slug, * }); * } * }, [assignments]); * * return null; * } * ``` */ export declare function useAbTestAssignments(options?: UseAbTestAssignmentsOptions): ActiveAbTestAssignment[] | null; //# sourceMappingURL=useAbTestAssignments.d.ts.map