@adstage/web-sdk 2.6.0 → 2.6.2

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.
package/dist/index.d.ts CHANGED
@@ -21,6 +21,8 @@ interface AdStageConfig {
21
21
  timeout?: number;
22
22
  /** 플레이스홀더 스타일 모드 (기본값: 'subtle') */
23
23
  placeholderMode?: 'invisible' | 'transparent' | 'subtle' | 'minimal' | 'debug' | 'legacy';
24
+ /** 고객 앱 버전 (선택사항, 기본값: '1.0.0') */
25
+ appVersion?: string;
24
26
  }
25
27
  /**
26
28
  * 모듈 기본 인터페이스
@@ -390,8 +392,8 @@ declare class ConfigModule implements BaseModule {
390
392
  }
391
393
 
392
394
  /**
393
- * AdStage SDK - Events 모듈 (기본 구조)
394
- * 이벤트 추적 시스템 - Q1 2025 구현 예정
395
+ * AdStage SDK - Events 모듈
396
+ * 이벤트 추적 시스템
395
397
  */
396
398
 
397
399
  interface EventProperties {
@@ -419,33 +421,27 @@ declare class EventsModule implements BaseModule {
419
421
  */
420
422
  getConfig(): AdStageConfig | null;
421
423
  /**
422
- * 커스텀 이벤트 추적
423
- * @example AdStage.events.track('page_view', { page: '/products' })
424
+ * 사용자 ID 설정
424
425
  */
425
- track(eventName: string, properties?: EventProperties): Promise<void>;
426
+ setUserId(userId: string): void;
426
427
  /**
427
- * 페이지 이벤트
428
- * @example AdStage.events.pageView({ page: '/home', title: 'Homepage' })
428
+ * 현재 사용자 ID 반환
429
429
  */
430
- pageView(pageData?: PageData): Promise<void>;
430
+ getUserId(): string | undefined;
431
431
  /**
432
- * 사용자 액션 이벤트
433
- * @example AdStage.events.userAction('button_click', { button_id: 'cta' })
432
+ * 이벤트 추적
433
+ * @param eventName 이벤트 이름
434
+ * @param properties 이벤트 속성
434
435
  */
435
- userAction(actionType: string, metadata?: EventProperties): Promise<void>;
436
+ track(eventName: string, properties?: EventProperties): Promise<void>;
436
437
  /**
437
- * 컨버전 이벤트
438
- * @example AdStage.events.conversion({ type: 'purchase', value: 99.99 })
438
+ * 페이지 이벤트 (track의 편의 메소드)
439
439
  */
440
- conversion(conversionData: EventProperties): Promise<void>;
441
- batch: {
442
- start: () => void;
443
- add: (eventName: string, properties: EventProperties) => void;
444
- flush: () => Promise<void>;
445
- };
446
- realtime: {
447
- track: (eventName: string, properties: EventProperties) => Promise<void>;
448
- };
440
+ pageView(pageData?: PageData): Promise<void>;
441
+ /**
442
+ * 서버에 이벤트 전송
443
+ */
444
+ private sendEventToServer;
449
445
  }
450
446
 
451
447
  /**
@@ -506,6 +502,45 @@ declare class AdStage {
506
502
  };
507
503
  }
508
504
 
505
+ /**
506
+ * AdStage SDK - 전역 이벤트 함수들
507
+ * Firebase Analytics와 유사한 간단한 API 제공
508
+ */
509
+
510
+ /**
511
+ * 이벤트 추적 (메인 함수)
512
+ * @param eventName 이벤트 이름
513
+ * @param properties 이벤트 속성
514
+ *
515
+ * @example
516
+ * track('purchase', {
517
+ * transaction_id: 'T123',
518
+ * value: 99.99,
519
+ * currency: 'USD'
520
+ * });
521
+ */
522
+ declare function track(eventName: string, properties?: EventProperties): Promise<void>;
523
+ /**
524
+ * 페이지 뷰 추적
525
+ * @param pageData 페이지 정보
526
+ *
527
+ * @example
528
+ * pageView({ page: '/products', title: 'Products Page' });
529
+ */
530
+ declare function pageView(pageData?: PageData): Promise<void>;
531
+ /**
532
+ * 사용자 ID 설정
533
+ * @param userId 사용자 ID
534
+ *
535
+ * @example
536
+ * setUserId('user123');
537
+ */
538
+ declare function setUserId(userId: string): void;
539
+ /**
540
+ * 현재 사용자 ID 반환
541
+ */
542
+ declare function getUserId(): string | undefined;
543
+
509
544
  interface AdStageContextType {
510
545
  isInitialized: boolean;
511
546
  config: AdStageConfig | null;
@@ -541,4 +576,4 @@ declare function useAdStageInstance(): typeof AdStage | null;
541
576
  declare const SDK_VERSION = "2.0.0";
542
577
  declare const SUPPORTED_MODULES: readonly ["ads", "events", "config"];
543
578
 
544
- export { AdEventType, AdOptions, AdSlot, AdStage, AdStageConfig, AdStageProvider, AdType, Advertisement, ApiResponse, BaseModule, EventProperties, ModuleName, OrganizationInfo, PageData, SDK_VERSION, SUPPORTED_MODULES, useAdStageContext, useAdStageInstance };
579
+ export { AdEventType, AdOptions, AdSlot, AdStage, AdStageConfig, AdStageProvider, AdType, Advertisement, ApiResponse, BaseModule, EventProperties, ModuleName, OrganizationInfo, PageData, SDK_VERSION, SUPPORTED_MODULES, getUserId, pageView, setUserId, track, useAdStageContext, useAdStageInstance };