import { SDKConfig, PurchaseItem, PurchaseURLOptions, LoginURLOptions, Transaction, TipURLOptions, StorageAPI, StorageOptions, AffiliateLinkOptions } from './types'; export * from './types'; /** * Oncade SDK for integrating game purchases and wagering */ export declare class OncadeSDK { private apiClient; private authService; private purchaseService; private telemetryService?; private remoteConfigService?; private config; private apiUrl; private storageServiceFactory; private affiliateLinkService; /** * Create a new instance of the Oncade SDK * @param config SDK configuration */ constructor(config: SDKConfig); /** * Initialize the game server by verifying the game ID and API key * @returns Promise resolving to a boolean indicating success */ initialize(): Promise; track>(eventName: string, payload: EventPayload, options?: { flushImmediately?: boolean; }): void; flushTelemetry(): Promise; /** Typed getter with optional fallback */ getConfig(key: string, defaultValue?: T): Promise; /** Get entire config store */ getAllConfig(): Promise>; /** Subscribe to live changes for a single key */ onConfigChange(key: string, cb: (val: T) => void): () => void; /** * Get session information including user association status * @returns Promise resolving to session information including user ID if associated */ getSessionInfo(): Promise<{ isValid: boolean; hasUserId: boolean; sessionToken: string | null; }>; /** * Clear the current session data */ clearSession(): void; /** * Get the store catalog for the game * @returns Promise resolving to an array of purchasable items */ getStoreCatalog(): Promise; /** * Get a specific item from the store * @param itemId Item ID to retrieve * @returns Promise resolving to the item or null if not found */ getStoreItem(itemId: string): Promise; /** * Get a purchase URL for an item * @param options Purchase URL options * @returns The generated purchase URL or null if no valid session token exists */ getPurchaseURL(options: Omit & { sessionToken?: string; }): string | null; /** * Get purchased items for the current user * @returns Promise resolving to an array of purchased items */ getPurchasedItems(): Promise; /** * Get transaction history for the current user * @returns Promise resolving to an array of transactions */ getTransactionHistory(): Promise; /** * Extract parameters from a store link * @param url URL to extract parameters from * @returns Object containing affiliateCode if present */ handleStoreLink(url: string): { affiliateCode?: string; }; /** * Parse parameters from a deep link URL * @param url URL to parse * @returns Object containing the parsed parameters */ parseDeepLinkParams(url: string): Record; /** * Override the API URL (for testing purposes only) * @param url The URL to use for API calls */ setApiUrlForTesting(url: string, storeUrl: string): void; /** * Get a login URL for user authentication and session association * @param options Login URL options * @returns The generated login URL */ getLoginURL(options: LoginURLOptions): string; /** * Get a tip URL to allow users to give a tip to the developer * @param options Tip URL options * @returns The generated tip URL or null if no valid session token exists */ getTipURL(options: Omit & { sessionToken?: string; }): string | null; /** * Storage API */ storage(opts: StorageOptions): StorageAPI; /** * Create an affiliate link (fetches userId from API if needed) * @param opts Affiliate link options (targetUrl, gameId, etc.) * @returns Promise affiliate link URL */ createAffiliateLink(opts: Omit): Promise; /** * Get the affiliate code you arrived with (from query param) */ getReferrerAffiliateCode(): string | null; /** * Resolve the current user ID from the session token (internal helper) */ private resolveUserId; /** * Get the affiliate code for the current user (async) */ getMyAffiliateCode(): Promise; /** * Wrap a URL with the current user's affiliate code (async) */ wrapUrl(url: string): Promise; } export default OncadeSDK; //# sourceMappingURL=index.d.ts.map