const runtimeGlobals = globalThis as Record; const sdkEnvKey = 'NAMI_SDK' + '_ENV'; if (typeof runtimeGlobals[sdkEnvKey] !== 'string' || runtimeGlobals[sdkEnvKey] === '') { const devFlag = typeof __DEV__ === 'boolean' ? __DEV__ : false; runtimeGlobals[sdkEnvKey] = devFlag ? 'development' : 'production'; } // ─── Side-effect: register adapters ────────────────────────────────── import './adapters'; // ─── Nami wrapper ──────────────────────────────────────────────────── export { Nami } from './nami'; // ─── Primary component ────────────────────────────────────────────── export { NamiView } from './components/NamiView'; // ─── Managers (re-exported from core) ──────────────────────────────── // NamiProfileManager intentionally omitted — its source class has no // public statics; the public surface lives entirely on NamiCustomerManager. // Internal callers needing the class import it from the // `_internal` namespace on `@namiml/sdk-core` (NAM-1217). See NAM-1207. export { NamiCampaignManager, NamiCustomerManager, NamiPaywallManager, NamiEntitlementManager, NamiFlowManager, NamiPurchaseManager, } from '@namiml/sdk-core'; // ─── Variant D handoff-outcome vocabularies (NAM-1562) ────────────── // Const objects (value AND type), so they re-export as values — `export type` // would drop the runtime objects handoff handlers read (NamiHandoffTag.SignIn, // NamiPermissionOutcome.Push). The engine + routing live in @namiml/sdk-core // (NAM-1557); Expo consumes the v2 `registerStepHandoff` on NamiFlowManager // (already exported above) and reports outcomes via `complete(outcome)`. export { NamiHandoffTag, NamiPermissionOutcome } from '@namiml/sdk-core'; // ─── Types (re-exported from core) ────────────────────────────────── export type { NamiConfiguration, NamiCampaign, NamiSKU, NamiSKUType, NamiEntitlement, NamiPurchase, NamiPurchaseSuccess, NamiPaywallEvent, NamiPaywallAction, NamiPaywallLaunchContext, NamiLogLevel, NamiLanguageCodes, CustomerJourneyState, NamiProductDetails, NamiFlow, // Text Input component (NAM-1148) — typing parity with the native/Web ports. TTextInputComponent, TTextInputType, FormFieldValidator, IPurchaseAdapter, PurchaseContext, PurchaseResult, // Variant D handoff outcomes (NAM-1562) — handler + typed-outcome contracts. NamiFlowHandoffStepHandler, NamiFlowEventHandler, NamiHandoffComplete, NamiHandoffOutcome, NamiLoginSuccess, NamiHandoffAttributeValue, NamiUserDataEnvelope, } from '@namiml/sdk-core'; // ─── Adapters (advanced use) ──────────────────────────────────────── export { ExpoStorageAdapter, ExpoDeviceAdapter, ExpoUIAdapter, ExpoPurchaseAdapter, } from './adapters'; // ─── Context (advanced use) ───────────────────────────────────────── export { PaywallProvider, usePaywallContext } from './context/PaywallContext'; // ─── Internal components (for customization) ──────────────────────── export { PaywallScreen } from './components/PaywallScreen'; export { TemplateRenderer } from './components/TemplateRenderer';