/** * Auto-Identify Module * * Automatically captures user identity (email) from: * 1. Fetch/XHR API requests (email in request/response) * 2. Form submissions (email inputs) * 3. Shopify-specific endpoints (/account.json) * * SECURITY: * - Email validation to prevent false positives * - Whitelist approach for trusted domains * - Rate limiting to prevent spam * - Privacy controls integration */ interface AutoIdentifyConfig { enabled?: boolean; captureFromForms?: boolean; captureFromAPI?: boolean; captureFromShopify?: boolean; trustedDomains?: string[]; debug?: boolean; } export declare class AutoIdentifyManager { private config; private identifyCallback?; private originalFetch?; private originalXHROpen?; private originalXHRSend?; private formListeners; private lastIdentifyTime; private RATE_LIMIT_MS; private shopifyCheckInterval?; private formObserver?; private destroyed; private static THIRD_PARTY_EMAIL_FIELD; constructor(config?: AutoIdentifyConfig); /** * Initialize auto-identify system */ initialize(identifyCallback: (email: string, source: string) => void): Promise; /** * Setup form monitoring for email capture */ private setupFormMonitoring; /** * The form's email input that belongs to the VISITOR (not a gift/recipient field), or * null when there's no usable / unambiguous one. (FSR-49) */ private findVisitorEmailInput; private isThirdPartyEmailField; /** * Scan DOM for forms with email inputs */ private scanForEmailForms; /** * Handle form submission */ private handleFormSubmit; /** * Setup fetch interception for API email capture */ private setupFetchInterception; /** * Setup XHR interception for API email capture */ private setupXHRInterception; /** * Setup Shopify-specific monitoring */ private setupShopifyMonitoring; /** * Check if running on Shopify */ private isShopify; /** * Check Shopify customer endpoint for email */ private checkShopifyCustomer; /** * Extract email from data (object, string, FormData) */ private extractEmailFromData; /** * Recursively find emails in object */ private findEmailsInObject; /** * Check if domain is trusted for auto-identify */ private isTrustedDomain; /** * Validate email format */ private isValidEmail; /** * Trigger identify with rate limiting */ private triggerIdentify; /** * Destroy and cleanup */ destroy(): void; /** * Debug logging */ private log; } export {}; //# sourceMappingURL=auto-identify.d.ts.map