@authorizeearth/react 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/constants.ts","../src/utils.ts","../src/styles.ts","../src/core.ts","../src/react.tsx"],"names":["useState","useRef","useEffect","useCallback","React"],"mappings":";;;;;;;;;AAUO,IAAM,SAAA,GAAY,wBAAA;AAElB,IAAM,cAAA,GAAiB,6BAAA;AAEvB,IAAM,iBAAA,GAAoB,GAAA;AAE1B,IAAM,OAAA,GAAU;AAAA,EACrB,IAAA,EAAM,+BAAA;AAAA,EACN,IAAA,EAAM;AACR,CAAA;AAEO,IAAM,eAAA,GAAqC;AAAA,EAChD,OAAA,CAAQ,IAAA;AAAA,EACR,OAAA,CAAQ,IAAA;AAAA,EACR,4BAAA;AAAA,EACA;AACF,CAAA;;;ACVO,SAAS,cAAc,MAAA,EAAyB;AACrD,EAAA,OAAO,eAAA,CAAgB,SAAS,MAAM,CAAA;AACxC;AAKO,SAAS,gBAAgB,QAAA,EAA2B;AACzD,EAAA,OAAO,QAAA,GAAW,OAAA,CAAQ,IAAA,GAAO,OAAA,CAAQ,IAAA;AAC3C;AAKO,SAAS,gBAAA,GAA4B;AAC1C,EAAA,OAAO,OAAO,UAAA,IAAc,iBAAA;AAC9B;AAgBO,SAAS,eAAe,MAAA,EAAiC;AAC9D,EAAA,MAAM;AAAA,IACJ,YAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA;AAAA,IACA,YAAA;AAAA,IACA,aAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF,GAAI,MAAA;AAEJ,EAAA,MAAM,MAAA,GAAS,OAAO,QAAA,CAAS,MAAA;AAC/B,EAAA,MAAM,SAAA,GAAY,OAAO,QAAA,CAAS,IAAA;AAClC,EAAA,MAAM,YAAA,GAAe,gBAAgB,QAAQ,CAAA;AAC7C,EAAA,MAAM,SAAA,GAAY,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,CAAA;AAEL,EAAA,OAAO,EAAE,IAAA,EAAM,KAAA,EAAO,KAAA,EAAO,KAAA,EAAM;AACrC;AA+GO,SAAS,oBAAA,CAAqB;AAAA,EACnC,YAAA;AAAA,EACA,WAAA;AAAA,EACA,KAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA;AAAA,EACA,aAAA;AAAA,EACA,aAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA,GAAW,iBAAA;AAAA,EACX,SAAA;AAAA,EACA,KAAA;AAAA,EACA;AACF,CAAA,EAA2C;AACzC,EAAA,MAAM,EAAE,IAAA,EAAM,KAAA,EAAM,GAAI,iBAAA,CAAkB;AAAA,IACxC,YAAA;AAAA,IACA,WAAA;AAAA,IACA,KAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,aAAA;AAAA,IACA,aAAA;AAAA,IACA,SAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,GACD,CAAA;AAED,EAAA,uBACEC,sBAAA,CAAA,aAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,IAAA,EAAK,QAAA;AAAA,MACL,OAAA,EAAS,IAAA;AAAA,MACT,QAAA,EAAU,YAAY,CAAC,KAAA;AAAA,MACvB,SAAA;AAAA,MACA;AAAA,KAAA;AAAA,IAEC;AAAA,GACH;AAEJ","file":"index.js","sourcesContent":["/**\n * SDK Constants\n *\n * Centralized configuration values, allowed origins, and\n * environment-specific settings for the AuthorizeEarth SDK.\n *\n * @module constants\n * @internal\n */\n\nexport const IFRAME_ID = 'authorize-earth-iframe';\n\nexport const SHADOW_HOST_ID = 'authorize-earth-shadow-host';\n\nexport const MOBILE_BREAKPOINT = 640;\n\nexport const ORIGINS = {\n live: 'https://id.authorizeearth.com',\n test: 'https://dashboard.authorizeearth.com',\n} as const;\n\nexport const ALLOWED_ORIGINS: readonly string[] = [\n ORIGINS.live,\n ORIGINS.test,\n 'https://id.authorize.earth',\n 'https://dashboard.authorize.earth',\n];","/**\n * SDK Utilities\n *\n * Helper functions for origin validation, URL construction,\n * and viewport detection used throughout the SDK.\n *\n * @module utils\n * @internal\n */\n\nimport { ALLOWED_ORIGINS, ORIGINS, MOBILE_BREAKPOINT } from './constants';\nimport type { DisplayMode, Theme } from './types';\n\n/**\n * Validates that a message origin is from an allowed AuthorizeEarth domain.\n */\nexport function isValidOrigin(origin: string): boolean {\n return ALLOWED_ORIGINS.includes(origin);\n}\n\n/**\n * Determines the target origin for iframe communication.\n */\nexport function getTargetOrigin(testMode: boolean): string {\n return testMode ? ORIGINS.test : ORIGINS.live;\n}\n\n/**\n * Checks if the current viewport is considered mobile-sized.\n */\nexport function isMobileViewport(): boolean {\n return window.innerWidth <= MOBILE_BREAKPOINT;\n}\n\nexport interface IframeUrlParams {\n sessionToken: string;\n displayMode: DisplayMode;\n testMode: boolean;\n theme?: Theme;\n externalHash?: string;\n integrationId?: string;\n templateId?: string;\n simulateError?: string;\n}\n\n/**\n * Constructs the URL for the verification iframe.\n */\nexport function buildIframeUrl(params: IframeUrlParams): string {\n const {\n sessionToken,\n displayMode,\n testMode,\n theme,\n externalHash,\n integrationId,\n templateId,\n simulateError,\n } = params;\n\n const origin = window.location.origin;\n const parentUrl = window.location.href;\n const targetOrigin = getTargetOrigin(testMode);\n const urlParams = new URLSearchParams();\n\n urlParams.set('mode', displayMode);\n urlParams.set('origin', origin);\n urlParams.set('parent_url', parentUrl);\n\n if (theme) {\n urlParams.set('theme', theme);\n }\n\n if (testMode) {\n if (templateId) urlParams.set('template', templateId);\n if (sessionToken) urlParams.set('integration_session_id', sessionToken);\n if (integrationId) urlParams.set('integration_id', integrationId);\n if (externalHash) urlParams.set('external_hash', externalHash);\n if (simulateError) urlParams.set('simulate_error', simulateError);\n\n return `${targetOrigin}/idv-test?${urlParams.toString()}`;\n }\n\n urlParams.set('integration_session_id', sessionToken);\n if (integrationId) urlParams.set('integration_id', integrationId);\n if (externalHash) urlParams.set('external_hash', externalHash);\n\n return `${targetOrigin}/?${urlParams.toString()}`;\n}","/**\n * SDK Styles\n *\n * CSS generation and DOM element creation for the verification UI.\n * All styles are injected into a Shadow DOM to prevent conflicts\n * with the host page's styles.\n *\n * @module styles\n * @internal\n */\n\nimport type { Theme, DisplayMode } from './types';\n\n/**\n * Generates the complete CSS stylesheet for the SDK UI.\n *\n * Includes styles for:\n * - Modal and fullscreen display modes\n * - Loading placeholder with spinner\n * - Light and dark theme variants\n * - Animations (fade-in, spinner rotation)\n *\n * @param theme - The active theme ('light' or 'dark')\n * @returns Complete CSS stylesheet as a string\n */\nexport function getStyles(theme: Theme): string {\n const isDark = theme === 'dark';\n\n return `\n @keyframes authorize-earth-fade-in {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n\n @keyframes authorize-earth-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n }\n\n * {\n box-sizing: border-box;\n }\n\n .authorize-earth-container {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n z-index: 2147483647;\n animation: authorize-earth-fade-in 0.2s ease-out forwards;\n font-family: system-ui, -apple-system, sans-serif;\n }\n\n .authorize-earth-container.authorize-earth-fullscreen .authorize-earth-backdrop {\n display: none;\n }\n\n .authorize-earth-container.authorize-earth-fullscreen .authorize-earth-iframe-wrapper {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: ${isDark ? '#0a0a0a' : 'white'};\n }\n\n .authorize-earth-container.authorize-earth-fullscreen .authorize-earth-iframe {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: none;\n background: ${isDark ? '#0a0a0a' : 'transparent'};\n }\n\n .authorize-earth-container.authorize-earth-modal {\n display: flex;\n align-items: flex-start;\n justify-content: center;\n overflow-y: auto;\n }\n\n .authorize-earth-container.authorize-earth-modal .authorize-earth-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: ${isDark ? 'rgba(0, 0, 0, 0.9)' : 'rgba(0, 0, 0, 0.5)'};\n cursor: pointer;\n }\n\n .authorize-earth-container.authorize-earth-modal .authorize-earth-modal-content {\n position: relative;\n z-index: 1;\n width: 100%;\n max-width: 480px;\n margin: auto 0;\n min-height: 200px;\n }\n\n .authorize-earth-container.authorize-earth-modal .authorize-earth-iframe-wrapper {\n width: 100%;\n min-height: 300px;\n height: auto;\n border: none;\n border-radius: 16px;\n box-shadow: ${isDark\n ? '0 25px 50px -12px rgba(0, 0, 0, 0.8)'\n : '0 25px 50px -12px rgba(0, 0, 0, 0.25)'};\n background: ${isDark ? '#0a0a0a' : 'white'};\n display: block;\n position: relative;\n overflow: hidden;\n transition: height 0.15s ease-out;\n }\n\n .authorize-earth-container.authorize-earth-modal .authorize-earth-iframe {\n width: 100%;\n height: 100%;\n min-height: 300px;\n border: none;\n border-radius: 16px;\n background: transparent;\n display: block;\n position: relative;\n z-index: 1;\n opacity: 0;\n pointer-events: none;\n }\n\n .authorize-earth-container.authorize-earth-modal .authorize-earth-iframe.authorize-earth-ready {\n opacity: 1;\n pointer-events: auto;\n }\n\n .authorize-earth-loading-placeholder {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 32px;\n min-height: 300px;\n background: ${isDark ? '#0a0a0a' : '#ffffff'};\n border-radius: 16px;\n z-index: 0;\n }\n\n .authorize-earth-loading-placeholder.authorize-earth-hidden {\n display: none;\n }\n\n .authorize-earth-loading-content {\n text-align: center;\n }\n\n .authorize-earth-spinner {\n width: 32px;\n height: 32px;\n margin: 0 auto 16px auto;\n animation: authorize-earth-spin 1s linear infinite;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .authorize-earth-spinner svg {\n width: 32px;\n height: 32px;\n display: block;\n }\n\n .authorize-earth-loading-text {\n font-size: 16px;\n line-height: 1.5;\n color: ${isDark ? '#a3a3a3' : '#4b5563'};\n margin: 0;\n font-weight: 400;\n }\n `;\n}\n\n/**\n * Creates the loading placeholder element shown while the iframe loads.\n *\n * @param theme - The active theme for color styling\n * @returns A div element containing the loading spinner and text\n */\nexport function createLoadingPlaceholder(theme: Theme): HTMLDivElement {\n const isDark = theme === 'dark';\n const spinnerColor = isDark ? '#737373' : '#9ca3af';\n\n const placeholder = document.createElement('div');\n placeholder.className = 'authorize-earth-loading-placeholder';\n\n placeholder.innerHTML = `\n <div class=\"authorize-earth-loading-content\">\n <div class=\"authorize-earth-spinner\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"color: ${spinnerColor}\">\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\"/>\n </svg>\n </div>\n <p class=\"authorize-earth-loading-text\">Loading verification session...</p>\n </div>\n `;\n\n return placeholder;\n}\n\n/**\n * Result of creating a Shadow DOM container for the SDK UI.\n */\nexport interface ShadowContainerElements {\n /** The host element attached to the document body */\n shadowHost: HTMLDivElement;\n /** The shadow root for style isolation */\n shadowRoot: ShadowRoot;\n /** Main container element */\n container: HTMLDivElement;\n /** Backdrop element for modal mode */\n backdrop: HTMLDivElement;\n /** Modal content wrapper (null in fullscreen mode) */\n modalContent: HTMLDivElement | null;\n /** Wrapper around the iframe */\n iframeWrapper: HTMLDivElement;\n /** Loading placeholder shown during iframe load */\n loadingPlaceholder: HTMLDivElement;\n}\n\n/**\n * Creates the complete Shadow DOM structure for the verification UI.\n *\n * Uses Shadow DOM to:\n * - Isolate SDK styles from the host page\n * - Prevent host page styles from affecting the SDK\n * - Ensure consistent appearance across integrations\n *\n * @param mode - Display mode ('modal' or 'fullscreen')\n * @param theme - Theme for styling ('light' or 'dark')\n * @returns Object containing all created DOM elements\n */\nexport function createShadowContainer(\n mode: DisplayMode,\n theme: Theme\n): ShadowContainerElements {\n const shadowHost = document.createElement('div');\n shadowHost.id = 'authorize-earth-shadow-host';\n\n const shadowRoot = shadowHost.attachShadow({ mode: 'closed' });\n\n const styleSheet = document.createElement('style');\n styleSheet.textContent = getStyles(theme);\n shadowRoot.appendChild(styleSheet);\n\n const container = document.createElement('div');\n container.className = `authorize-earth-container ${\n mode === 'modal' ? 'authorize-earth-modal' : 'authorize-earth-fullscreen'\n }`;\n\n const backdrop = document.createElement('div');\n backdrop.className = 'authorize-earth-backdrop';\n container.appendChild(backdrop);\n\n let modalContent: HTMLDivElement | null = null;\n\n const iframeWrapper = document.createElement('div');\n iframeWrapper.className = 'authorize-earth-iframe-wrapper';\n\n const loadingPlaceholder = createLoadingPlaceholder(theme);\n iframeWrapper.appendChild(loadingPlaceholder);\n\n if (mode === 'modal') {\n modalContent = document.createElement('div');\n modalContent.className = 'authorize-earth-modal-content';\n modalContent.appendChild(iframeWrapper);\n container.appendChild(modalContent);\n } else {\n container.appendChild(iframeWrapper);\n }\n\n shadowRoot.appendChild(container);\n\n return {\n shadowHost,\n shadowRoot,\n container,\n backdrop,\n modalContent,\n iframeWrapper,\n loadingPlaceholder,\n };\n}","/**\n * Core SDK Module\n *\n * Main entry point for creating and managing AuthorizeEarth\n * verification instances. Handles iframe lifecycle, message\n * communication, and UI state management.\n *\n * @module core\n */\n\nimport type {\n AuthorizeEarthConfig,\n AuthorizeEarthInstance,\n IFrameMessage,\n VerificationResult,\n VerificationError,\n VerificationEvent,\n DisplayMode,\n ResizePayload,\n Theme,\n ThemeValidatedPayload,\n} from './types';\nimport { IFRAME_ID, SHADOW_HOST_ID } from './constants';\nimport { isValidOrigin, getTargetOrigin, isMobileViewport, buildIframeUrl } from './utils';\nimport { getStyles, createShadowContainer, type ShadowContainerElements } from './styles';\n\n/**\n * Creates a new AuthorizeEarth verification instance.\n *\n * This is the primary method for initializing the SDK. It returns\n * an instance with methods to control the verification flow.\n *\n * @example\n * ```typescript\n * const verification = create({\n * sessionToken: 'sess_xxx',\n * theme: 'light',\n * displayMode: 'modal',\n * onSuccess: (result) => {\n * console.log('Verified:', result.verificationId);\n * },\n * onError: (error) => {\n * console.error('Failed:', error.message);\n * },\n * });\n *\n * // Open when ready (e.g., on button click)\n * verification.open();\n *\n * // Clean up when done\n * verification.destroy();\n * ```\n *\n * @param config - Configuration options for the verification\n * @returns Instance with open, close, and destroy methods\n */\nexport function create(config: AuthorizeEarthConfig): AuthorizeEarthInstance {\n const {\n sessionToken,\n displayMode = 'modal',\n testMode = false,\n theme = 'light',\n externalHash,\n integrationId,\n templateId,\n simulateError,\n onSuccess,\n onError,\n onClose,\n onEvent,\n } = config;\n\n const targetOrigin = getTargetOrigin(testMode);\n\n // DOM element references\n let shadowHost: HTMLDivElement | null = null;\n let shadowRoot: ShadowRoot | null = null;\n let container: HTMLDivElement | null = null;\n let backdrop: HTMLDivElement | null = null;\n let modalContent: HTMLDivElement | null = null;\n let iframeWrapper: HTMLDivElement | null = null;\n let loadingPlaceholder: HTMLDivElement | null = null;\n let iframe: HTMLIFrameElement | null = null;\n\n // Event handler references for cleanup\n let messageHandler: ((event: MessageEvent) => void) | null = null;\n let resizeHandler: (() => void) | null = null;\n\n // State flags\n let isDestroyed = false;\n let isTemporarilyFullscreen = false;\n let currentEffectiveMode: DisplayMode = displayMode;\n let currentTheme: Theme = theme;\n\n /**\n * Updates the Shadow DOM stylesheet when theme changes.\n */\n function updateStyles(): void {\n if (!shadowRoot) return;\n\n const styleSheet = shadowRoot.querySelector('style');\n if (styleSheet) {\n styleSheet.textContent = getStyles(currentTheme);\n }\n }\n\n /**\n * Reveals the iframe and hides the loading placeholder.\n * Called when the iframe signals it's ready.\n */\n function showIframe(): void {\n if (iframe && !iframe.classList.contains('authorize-earth-ready')) {\n iframe.classList.add('authorize-earth-ready');\n }\n if (loadingPlaceholder) {\n loadingPlaceholder.classList.add('authorize-earth-hidden');\n }\n }\n\n /**\n * Switches the UI to fullscreen mode.\n * Used for mobile viewports or camera access requests.\n */\n function switchToFullscreen(): void {\n if (!container || !iframe || !iframeWrapper) return;\n currentEffectiveMode = 'fullscreen';\n container.className = 'authorize-earth-container authorize-earth-fullscreen';\n // DO NOT reparent. Let CSS handle the layout via the container class.\n iframeWrapper.style.cssText = '';\n iframe.style.cssText = '';\n iframe.classList.add('authorize-earth-ready');\n iframe.contentWindow?.postMessage({ type: 'authorize_earth_switch_fullscreen' }, '*');\n }\n\n /**\n * Switches the UI back to modal mode.\n * Used when returning from fullscreen on desktop.\n */\n function switchToModal(): void {\n if (!container || !iframe || !iframeWrapper) return;\n \n currentEffectiveMode = 'modal';\n container.className = 'authorize-earth-container authorize-earth-modal';\n \n if (!modalContent) {\n modalContent = document.createElement('div');\n modalContent.className = 'authorize-earth-modal-content';\n container.appendChild(modalContent);\n }\n \n if (iframeWrapper.parentElement !== modalContent) {\n modalContent.appendChild(iframeWrapper);\n }\n \n iframeWrapper.style.cssText = '';\n iframe.style.cssText = '';\n iframe.classList.add('authorize-earth-ready');\n \n iframe.contentWindow?.postMessage(\n { type: 'authorize_earth_switch_modal' },\n '*'\n );\n }\n\n /**\n * Handles window resize events.\n * Automatically switches between modal/fullscreen based on viewport.\n */\n function handleWindowResize(): void {\n if (!container || !iframe || isTemporarilyFullscreen) return;\n\n const isMobile = isMobileViewport();\n const isCurrentlyModal = container.classList.contains('authorize-earth-modal');\n const isCurrentlyFullscreen = container.classList.contains('authorize-earth-fullscreen');\n\n if (isMobile && isCurrentlyModal) {\n switchToFullscreen();\n } else if (!isMobile && isCurrentlyFullscreen && displayMode === 'modal') {\n switchToModal();\n }\n }\n\n /**\n * Handles postMessage events from the verification iframe.\n * Routes messages to appropriate handlers based on type.\n */\n function handleMessage(event: MessageEvent): void {\n if (!isValidOrigin(event.origin)) return;\n\n const message = event.data as IFrameMessage;\n\n switch (message.type) {\n case 'authorize_earth_ready':\n showIframe();\n onEvent?.({ type: 'ready', timestamp: Date.now() });\n break;\n\n case 'authorize_earth_theme_validated': {\n const payload = message.payload as ThemeValidatedPayload;\n if (!payload.has_custom_branding && currentTheme === 'dark') {\n currentTheme = 'light';\n updateStyles();\n console.warn(\n '[AuthorizeEarth] Dark mode requires custom branding. Falling back to light mode.'\n );\n }\n onEvent?.({\n type: 'theme_validated',\n timestamp: Date.now(),\n metadata: {\n theme: currentTheme,\n has_custom_branding: payload.has_custom_branding,\n },\n });\n break;\n }\n\n case 'authorize_earth_success':\n onSuccess?.(message.payload as VerificationResult);\n // Don't destroy here - let the user see the success screen and click Finish\n // destroy() will be called when authorize_earth_close is received\n break;\n \n case 'authorize_earth_error':\n showIframe();\n onError?.(message.payload as VerificationError);\n break;\n\n case 'authorize_earth_close':\n onClose?.();\n destroy();\n break;\n\n case 'authorize_earth_event':\n handleVerificationEvent(message.payload as VerificationEvent);\n break;\n\n case 'authorize_earth_resize':\n handleResize(message.payload as ResizePayload | undefined);\n break;\n\n case 'authorize_earth_redirect': {\n const redirectPayload = message.payload as { url: string } | undefined;\n if (redirectPayload?.url) {\n window.location.href = redirectPayload.url;\n }\n break;\n }\n case 'authorize_earth_passkey_complete': {\n // Passkey registration completed successfully, close the modal\n onSuccess?.(message.payload as VerificationResult);\n destroy();\n break;\n }\n \n case 'authorize_earth_passkey_skip': {\n // User skipped passkey registration, close the modal\n onClose?.();\n destroy();\n break;\n } \n }\n }\n\n /**\n * Handles resize messages from the iframe.\n * Adjusts modal height to fit content.\n */\n function handleResize(payload: ResizePayload | undefined): void {\n if (currentEffectiveMode === 'fullscreen' || !iframe || !iframeWrapper || !payload?.height) {\n return;\n }\n\n const height = Math.max(payload.height, 200);\n iframe.style.height = `${height}px`;\n iframeWrapper.style.height = `${height}px`;\n }\n\n /**\n * Handles click events on the modal backdrop.\n * Closes the verification when backdrop is clicked.\n */\n function handleBackdropClick(event: MouseEvent): void {\n const target = event.target as HTMLElement;\n if (target.classList.contains('authorize-earth-backdrop')) {\n close();\n }\n }\n\n /**\n * Processes verification lifecycle events.\n * Handles fullscreen requests for camera access.\n */\n function handleVerificationEvent(evt: VerificationEvent): void {\n if (evt.type === 'camera_fullscreen_request' && displayMode === 'modal' && !isMobileViewport()) {\n isTemporarilyFullscreen = true;\n switchToFullscreen();\n }\n\n if (evt.type === 'camera_fullscreen_exit' && displayMode === 'modal' && isTemporarilyFullscreen) {\n isTemporarilyFullscreen = false;\n if (!isMobileViewport()) {\n switchToModal();\n }\n }\n\n onEvent?.(evt);\n }\n\n /**\n * Opens the verification UI.\n * Creates the iframe and Shadow DOM container.\n */\n function open(): void {\n if (isDestroyed) {\n console.warn('[AuthorizeEarth] Cannot open a destroyed instance. Create a new one.');\n return;\n }\n\n if (shadowHost) {\n console.warn('[AuthorizeEarth] Already open.');\n return;\n }\n\n if (testMode && !templateId) {\n console.error('[AuthorizeEarth] templateId is required for test mode.');\n onError?.({\n code: 'MISSING_TEMPLATE_ID',\n message: 'templateId is required for test mode sessions',\n });\n return;\n }\n\n // Remove any existing instance\n const existingHost = document.getElementById(SHADOW_HOST_ID);\n if (existingHost) {\n existingHost.remove();\n }\n\n // Determine effective display mode based on viewport\n const isMobile = isMobileViewport();\n const effectiveDisplayMode = isMobile ? 'fullscreen' : displayMode;\n currentEffectiveMode = effectiveDisplayMode;\n\n // Create Shadow DOM structure\n const shadowElements: ShadowContainerElements = createShadowContainer(\n effectiveDisplayMode,\n currentTheme\n );\n\n shadowHost = shadowElements.shadowHost;\n shadowRoot = shadowElements.shadowRoot;\n container = shadowElements.container;\n backdrop = shadowElements.backdrop;\n modalContent = shadowElements.modalContent;\n iframeWrapper = shadowElements.iframeWrapper;\n loadingPlaceholder = shadowElements.loadingPlaceholder;\n\n // Create and configure iframe\n iframe = document.createElement('iframe');\n iframe.id = IFRAME_ID;\n iframe.className = 'authorize-earth-iframe';\n iframe.src = buildIframeUrl({\n sessionToken,\n displayMode: effectiveDisplayMode,\n testMode,\n theme: currentTheme,\n externalHash,\n integrationId,\n templateId,\n simulateError,\n });\n iframe.allow = 'camera; microphone; publickey-credentials-get *; publickey-credentials-create *';\n iframe.setAttribute('allowfullscreen', 'true');\n\n iframeWrapper.appendChild(iframe);\n\n // Attach event listeners\n backdrop.addEventListener('click', handleBackdropClick);\n\n messageHandler = handleMessage;\n window.addEventListener('message', messageHandler);\n\n resizeHandler = handleWindowResize;\n window.addEventListener('resize', resizeHandler);\n\n // Mount to DOM\n document.body.appendChild(shadowHost);\n\n onEvent?.({ type: 'open', timestamp: Date.now() });\n }\n\n /**\n * Requests the verification UI to close.\n * Sends a close request to the iframe.\n */\n function close(): void {\n iframe?.contentWindow?.postMessage(\n { type: 'authorize_earth_close_request' },\n targetOrigin\n );\n }\n\n /**\n * Destroys the instance and cleans up all resources.\n * Must be called when done with the instance.\n */\n function destroy(): void {\n if (isDestroyed) return;\n\n if (messageHandler) {\n window.removeEventListener('message', messageHandler);\n messageHandler = null;\n }\n\n if (resizeHandler) {\n window.removeEventListener('resize', resizeHandler);\n resizeHandler = null;\n }\n\n if (backdrop) {\n backdrop.removeEventListener('click', handleBackdropClick);\n }\n\n if (shadowHost) {\n shadowHost.remove();\n shadowHost = null;\n shadowRoot = null;\n container = null;\n backdrop = null;\n modalContent = null;\n iframeWrapper = null;\n loadingPlaceholder = null;\n iframe = null;\n }\n\n isDestroyed = true;\n }\n\n return { open, close, destroy };\n}\n\n/**\n * Creates and immediately opens a verification instance.\n *\n * Convenience method that combines create() and open() for\n * simple use cases where immediate display is desired.\n *\n * @example\n * ```typescript\n * start({\n * sessionToken: 'sess_xxx',\n * onSuccess: (result) => console.log('Success:', result),\n * });\n * ```\n *\n * @param config - Configuration options for the verification\n */\nexport function start(config: AuthorizeEarthConfig): void {\n const instance = create(config);\n instance.open();\n}","/**\n * React Bindings\n *\n * React hook and component for integrating AuthorizeEarth\n * identity verification into React applications.\n *\n * @module react\n */\n\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { create } from './core';\nimport type {\n AuthorizeEarthInstance,\n VerificationResult,\n VerificationError,\n VerificationEvent,\n DisplayMode,\n Theme,\n} from './types';\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Hook Types\n// ─────────────────────────────────────────────────────────────────────────────\n\n/**\n * Configuration for the useAuthorizeEarth hook.\n *\n * Extends the core SDK configuration with React-specific patterns\n * like nullable sessionToken for loading states.\n */\nexport interface UseAuthorizeEarthConfig {\n /**\n * Session token from your backend.\n *\n * Pass `null` while the token is loading. The hook will not\n * be ready until a valid token string is provided.\n */\n sessionToken: string | null;\n\n /**\n * How to display the verification UI.\n * @default 'modal'\n */\n displayMode?: DisplayMode;\n\n /**\n * Theme for the verification UI.\n *\n * Note: `dark` requires custom branding configured in your\n * AuthorizeEarth dashboard.\n * @default 'light'\n */\n theme?: Theme;\n\n /** Called when verification completes successfully. */\n onSuccess?: (result: VerificationResult) => void;\n\n /** Called when an error occurs during verification. */\n onError?: (error: VerificationError) => void;\n\n /** Called when the user closes the verification UI. */\n onClose?: () => void;\n\n /** Called for lifecycle events during verification. */\n onEvent?: (event: VerificationEvent) => void;\n\n // ─────────────────────────────────────────────────────────────────\n // Test Mode Options\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Enable test mode for development and testing.\n * Requires `templateId` when true.\n * @default false\n */\n testMode?: boolean;\n\n /**\n * Template ID for test mode sessions.\n * Required when `testMode` is true.\n */\n templateId?: string;\n\n /**\n * Integration ID for test mode.\n */\n integrationId?: string;\n\n /**\n * Simulate specific error conditions in test mode.\n */\n simulateError?: string;\n}\n\n/**\n * Return value from the useAuthorizeEarth hook.\n */\nexport interface UseAuthorizeEarthReturn {\n /**\n * Opens the verification UI.\n * No-op if not ready or if sessionToken is null.\n */\n open: () => void;\n\n /**\n * Requests the verification UI to close.\n */\n close: () => void;\n\n /**\n * Whether the SDK is initialized and ready to open.\n * Will be false while sessionToken is null or loading.\n */\n ready: boolean;\n\n /**\n * Initialization error, if any occurred.\n * Check this before rendering to handle edge cases.\n */\n error: Error | null;\n}\n\n/**\n * React hook for integrating AuthorizeEarth identity verification.\n *\n * Manages the SDK instance lifecycle, ensuring proper cleanup on\n * unmount and when configuration changes.\n *\n * @example Basic usage\n * ```tsx\n * function VerifyButton({ sessionToken }) {\n * const { open, ready } = useAuthorizeEarth({\n * sessionToken,\n * onSuccess: (result) => {\n * console.log('Verified:', result.verificationId);\n * },\n * });\n *\n * return (\n * <button onClick={open} disabled={!ready}>\n * {ready ? 'Verify Identity' : 'Loading...'}\n * </button>\n * );\n * }\n * ```\n *\n * @example With theme and display mode\n * ```tsx\n * const { open, ready } = useAuthorizeEarth({\n * sessionToken,\n * theme: 'dark',\n * displayMode: 'fullscreen',\n * onSuccess: handleSuccess,\n * onError: handleError,\n * });\n * ```\n *\n * @param config - Hook configuration options\n * @returns Object with open/close methods and ready/error state\n */\nexport function useAuthorizeEarth(config: UseAuthorizeEarthConfig): UseAuthorizeEarthReturn {\n const {\n sessionToken,\n displayMode,\n theme,\n testMode,\n templateId,\n integrationId,\n simulateError,\n onSuccess,\n onError,\n onClose,\n onEvent,\n } = config;\n\n const [ready, setReady] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const instanceRef = useRef<AuthorizeEarthInstance | null>(null);\n\n // Store callbacks in refs to avoid re-creating the instance on callback changes.\n // This is a common React pattern to prevent unnecessary effect re-runs.\n const callbackRefs = useRef({ onSuccess, onError, onClose, onEvent });\n\n useEffect(() => {\n callbackRefs.current = { onSuccess, onError, onClose, onEvent };\n }, [onSuccess, onError, onClose, onEvent]);\n\n // Initialize/cleanup the SDK instance when configuration changes\n useEffect(() => {\n // Wait for session token before initializing\n if (!sessionToken) {\n setReady(false);\n return;\n }\n\n try {\n instanceRef.current = create({\n sessionToken,\n displayMode,\n theme,\n testMode,\n templateId,\n integrationId,\n simulateError,\n onSuccess: (result) => callbackRefs.current.onSuccess?.(result),\n onError: (err) => callbackRefs.current.onError?.(err),\n onClose: () => callbackRefs.current.onClose?.(),\n onEvent: (event) => {\n callbackRefs.current.onEvent?.(event);\n if (event.type === 'ready') {\n setReady(true);\n }\n },\n });\n\n setReady(true);\n setError(null);\n } catch (e) {\n const initError = e instanceof Error ? e : new Error('Failed to initialize AuthorizeEarth');\n setError(initError);\n setReady(false);\n }\n\n // Cleanup on unmount or when dependencies change\n return () => {\n instanceRef.current?.destroy();\n instanceRef.current = null;\n setReady(false);\n };\n }, [sessionToken, displayMode, theme, testMode, templateId, integrationId, simulateError]);\n\n const open = useCallback(() => {\n if (!instanceRef.current) {\n console.warn('[AuthorizeEarth] Cannot open: no session token provided.');\n return;\n }\n instanceRef.current.open();\n }, []);\n\n const close = useCallback(() => {\n instanceRef.current?.close();\n }, []);\n\n return { open, close, ready, error };\n}\n\n// Button Component Types\n\n/**\n * Props for the AuthorizeEarthButton component.\n *\n * Combines SDK configuration with standard button props.\n */\nexport interface AuthorizeEarthButtonProps {\n /**\n * Session token from your backend.\n * Pass `null` while loading - the button will be disabled.\n */\n sessionToken: string | null;\n\n /**\n * How to display the verification UI.\n * @default 'modal'\n */\n displayMode?: DisplayMode;\n\n /**\n * Theme for the verification UI.\n * @default 'light'\n */\n theme?: Theme;\n\n /** Called when verification completes successfully. */\n onSuccess?: (result: VerificationResult) => void;\n\n /** Called when an error occurs during verification. */\n onError?: (error: VerificationError) => void;\n\n /** Called when the user closes the verification UI. */\n onClose?: () => void;\n\n /** Called for lifecycle events during verification. */\n onEvent?: (event: VerificationEvent) => void;\n\n // ─────────────────────────────────────────────────────────────────\n // Test Mode Options\n // ─────────────────────────────────────────────────────────────────\n\n /** Enable test mode. Requires `templateId`. */\n testMode?: boolean;\n\n /** Template ID for test mode sessions. */\n templateId?: string;\n\n /** Integration ID for test mode. */\n integrationId?: string;\n\n /** Simulate specific error conditions in test mode. */\n simulateError?: string;\n\n // ─────────────────────────────────────────────────────────────────\n // Button Props\n // ─────────────────────────────────────────────────────────────────\n\n /**\n * Button content.\n * @default 'Verify Identity'\n */\n children?: React.ReactNode;\n\n /** CSS class name for the button element. */\n className?: string;\n\n /** Inline styles for the button element. */\n style?: React.CSSProperties;\n\n /**\n * Force disable the button.\n * The button is also disabled when `!ready`.\n */\n disabled?: boolean;\n}\n\n// Button Component Implementation\n\n/**\n * Pre-built button component for triggering identity verification.\n *\n * Wraps the useAuthorizeEarth hook with a button element,\n * automatically handling disabled states while loading.\n *\n * @example Basic usage\n * ```tsx\n * <AuthorizeEarthButton\n * sessionToken={sessionToken}\n * onSuccess={(result) => console.log('Success:', result)}\n * onError={(error) => console.error('Error:', error)}\n * >\n * Verify Your Identity\n * </AuthorizeEarthButton>\n * ```\n *\n * @example With theme and styling\n * ```tsx\n * <AuthorizeEarthButton\n * sessionToken={sessionToken}\n * theme=\"dark\"\n * displayMode=\"modal\"\n * className=\"btn btn-primary\"\n * onSuccess={handleSuccess}\n * >\n * Start Verification\n * </AuthorizeEarthButton>\n * ```\n */\nexport function AuthorizeEarthButton({\n sessionToken,\n displayMode,\n theme,\n testMode,\n templateId,\n integrationId,\n simulateError,\n onSuccess,\n onError,\n onClose,\n onEvent,\n children = 'Verify Identity',\n className,\n style,\n disabled,\n}: AuthorizeEarthButtonProps): JSX.Element {\n const { open, ready } = useAuthorizeEarth({\n sessionToken,\n displayMode,\n theme,\n testMode,\n templateId,\n integrationId,\n simulateError,\n onSuccess,\n onError,\n onClose,\n onEvent,\n });\n\n return (\n <button\n type=\"button\"\n onClick={open}\n disabled={disabled || !ready}\n className={className}\n style={style}\n >\n {children}\n </button>\n );\n}"]}