/** * BigCrunch Mobile Ads SDK for React Native * Type definitions */ export * from './config'; export * from './events'; export * from './ads'; /** * SDK Environment options */ export type Environment = 'production' | 'sandbox'; /** * Account type for the current user */ export type AccountType = 'guest' | 'logged_in' | 'paid' | 'subscriber' | 'free'; /** * Ad formats supported by the SDK */ export type AdFormat = 'banner' | 'interstitial' | 'rewarded'; /** * Banner ad sizes */ export type BannerSize = | 'BANNER' // 320x50 | 'LARGE_BANNER' // 320x100 | 'MEDIUM_RECTANGLE' // 300x250 | 'FULL_BANNER' // 468x60 | 'LEADERBOARD' // 728x90 | 'ADAPTIVE' // Adaptive banner | 'SMART'; // Smart banner (deprecated, use ADAPTIVE) /** * Custom ad size */ export interface CustomSize { width: number; height: number; } /** * SDK initialization options */ export interface InitializationOptions { /** Your BigCrunch property ID */ propertyId: string; /** Environment to use */ environment?: Environment; /** Enable debug logging */ debug?: boolean; /** Use mock configuration for testing (no backend required) */ useMockConfig?: boolean; /** Use Google's test ad units instead of production units */ useTestAds?: boolean; /** Custom backend URL (optional) */ customBackendUrl?: string; /** Session timeout in seconds (default: 1800) */ sessionTimeout?: number; } /** * Content metadata for a screen/page view * * Matches the `page_meta_data` fields in the BigCrunch analytics schema. */ export interface PageMetaData { /** Canonical page URL */ url?: string; /** Content author */ author?: string; /** Page/screen title */ title?: string; /** Featured image URL */ thumbnailUrl?: string; /** Content section/category */ articleSection?: string; /** Comma-separated keywords */ keywords?: string; /** Content creation date (ISO 8601) */ dateCreated?: string; /** Content last modified date (ISO 8601) */ dateModified?: string; /** Content publication date (ISO 8601) */ datePublished?: string; } /** * Options for customizing screen view tracking */ export interface ScreenViewOptions { /** Override the auto-generated page URL (must be a valid web URL) */ pageUrl?: string; /** Content metadata for this screen/page */ pageMeta?: PageMetaData; /** Custom key-value dimensions attached to analytics events */ customDimensions?: Record; } /** * Ad request options */ export interface AdRequestOptions { /** Placement ID from BigCrunch dashboard */ placementId: string; /** Custom targeting parameters */ customTargeting?: Record; /** Content URL for contextual targeting */ contentUrl?: string; /** Publisher provided ID */ publisherProvidedId?: string; } /** * Error codes for ad loading failures */ export enum AdErrorCode { UNKNOWN = 'UNKNOWN', NETWORK_ERROR = 'NETWORK_ERROR', NO_FILL = 'NO_FILL', INVALID_REQUEST = 'INVALID_REQUEST', INTERNAL_ERROR = 'INTERNAL_ERROR', INVALID_PLACEMENT = 'INVALID_PLACEMENT', NOT_INITIALIZED = 'NOT_INITIALIZED', ALREADY_LOADED = 'ALREADY_LOADED', NOT_LOADED = 'NOT_LOADED', TIMEOUT = 'TIMEOUT' } /** * Ad error object */ export interface AdError { code: AdErrorCode; message: string; underlyingError?: string; } /** * Ad revenue data from Impression-Level Revenue Data (ILRD) */ export interface AdRevenue { /** Revenue value in micros (millionths of currency unit) */ valueMicros: number; /** Currency code (e.g., 'USD') */ currencyCode: string; /** Ad unit that generated the revenue */ adUnitId?: string; /** Precision of the revenue value */ precision?: 'ESTIMATED' | 'PUBLISHER_PROVIDED' | 'PRECISE' | 'UNKNOWN'; } /** * Session information */ export interface SessionInfo { /** Unique session ID (UUID) */ sessionId: string; /** Persistent user ID (UUID, stored across app launches) */ userId: string; /** Session start timestamp in ISO 8601 format (e.g., "2025-01-15T10:30:00Z") */ sessionStartTime: string; /** True if this is the user's first session */ isNewUser: boolean; /** Number of screens/page views in current session */ sessionDepth: number; /** Number of screens viewed in session (deprecated, use sessionDepth) */ screenViewCount: number; /** Number of ads requested in session */ adRequestCount: number; /** Number of ads shown in session */ adImpressionCount: number; /** Total revenue in session (micros) */ totalRevenueMicros: number; /** Total number of sessions for this user (not currently provided by native SDKs) */ totalSessionCount?: number; /** Current page/screen ID (not currently provided by native SDKs) */ currentPageId?: string; /** UTM source parameter (not currently provided by native SDKs) */ utmSource?: string; /** UTM medium parameter (not currently provided by native SDKs) */ utmMedium?: string; /** UTM campaign parameter (not currently provided by native SDKs) */ utmCampaign?: string; /** UTM term parameter (not currently provided by native SDKs) */ utmTerm?: string; /** UTM content parameter (not currently provided by native SDKs) */ utmContent?: string; /** Session attribution source (not currently provided by native SDKs) */ sessionSource?: string; /** Session attribution medium (not currently provided by native SDKs) */ sessionMedium?: string; } /** * Device context information */ export interface DeviceContext { /** Device ID (IDFA/AAID when available) */ deviceId?: string; /** Operating system */ os: 'iOS' | 'Android'; /** OS version */ osVersion: string; /** Device model */ deviceModel: string; /** Device manufacturer */ deviceManufacturer?: string; /** Screen width in pixels */ screenWidth: number; /** Screen height in pixels */ screenHeight: number; /** Screen density */ screenDensity?: number; /** App version */ appVersion: string; /** SDK version */ sdkVersion: string; /** Network connection type */ connectionType?: 'wifi' | 'cellular' | 'ethernet' | 'unknown'; /** User's locale */ locale?: string; /** User's timezone */ timezone?: string; /** Country code (ISO 3166-1 alpha-2, e.g., "US", "GB") */ country?: string; /** Region/state code */ region?: string; /** Browser/SDK identifier for web schema (e.g., "BigCrunch iOS SDK 1.0.0") */ browser?: string; /** Device type for web schema (e.g., "iPhone 14", "Samsung Galaxy S21") */ device?: string; }