@adstage/web-sdk 2.6.1 → 2.6.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.
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,42 @@ 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
+ * 사용자 속성 설정
434
433
  */
435
- userAction(actionType: string, metadata?: EventProperties): Promise<void>;
434
+ setUserProperties(properties: {
435
+ gender?: 'male' | 'female' | 'other' | 'unknown';
436
+ country?: string;
437
+ city?: string;
438
+ age?: string;
439
+ language?: string;
440
+ [key: string]: any;
441
+ }): void;
436
442
  /**
437
- * 컨버전 이벤트
438
- * @example AdStage.events.conversion({ type: 'purchase', value: 99.99 })
443
+ * 현재 사용자 속성 반환
439
444
  */
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
- };
445
+ getUserProperties(): any;
446
+ /**
447
+ * 이벤트 추적
448
+ * @param eventName 이벤트 이름
449
+ * @param properties 이벤트 속성
450
+ */
451
+ track(eventName: string, properties?: EventProperties): Promise<void>;
452
+ /**
453
+ * 페이지 뷰 이벤트 (track의 편의 메소드)
454
+ */
455
+ pageView(pageData?: PageData): Promise<void>;
456
+ /**
457
+ * 서버에 이벤트 전송
458
+ */
459
+ private sendEventToServer;
449
460
  }
450
461
 
451
462
  /**
@@ -506,6 +517,45 @@ declare class AdStage {
506
517
  };
507
518
  }
508
519
 
520
+ /**
521
+ * AdStage SDK - 전역 이벤트 함수들
522
+ * Firebase Analytics와 유사한 간단한 API 제공
523
+ */
524
+
525
+ /**
526
+ * 이벤트 추적 (메인 함수)
527
+ * @param eventName 이벤트 이름
528
+ * @param properties 이벤트 속성
529
+ *
530
+ * @example
531
+ * track('purchase', {
532
+ * transaction_id: 'T123',
533
+ * value: 99.99,
534
+ * currency: 'USD'
535
+ * });
536
+ */
537
+ declare function track(eventName: string, properties?: EventProperties): Promise<void>;
538
+ /**
539
+ * 페이지 뷰 추적
540
+ * @param pageData 페이지 정보
541
+ *
542
+ * @example
543
+ * pageView({ page: '/products', title: 'Products Page' });
544
+ */
545
+ declare function pageView(pageData?: PageData): Promise<void>;
546
+ /**
547
+ * 사용자 ID 설정
548
+ * @param userId 사용자 ID
549
+ *
550
+ * @example
551
+ * setUserId('user123');
552
+ */
553
+ declare function setUserId(userId: string): void;
554
+ /**
555
+ * 현재 사용자 ID 반환
556
+ */
557
+ declare function getUserId(): string | undefined;
558
+
509
559
  interface AdStageContextType {
510
560
  isInitialized: boolean;
511
561
  config: AdStageConfig | null;
@@ -541,4 +591,4 @@ declare function useAdStageInstance(): typeof AdStage | null;
541
591
  declare const SDK_VERSION = "2.0.0";
542
592
  declare const SUPPORTED_MODULES: readonly ["ads", "events", "config"];
543
593
 
544
- export { AdEventType, AdOptions, AdSlot, AdStage, AdStageConfig, AdStageProvider, AdType, Advertisement, ApiResponse, BaseModule, EventProperties, ModuleName, OrganizationInfo, PageData, SDK_VERSION, SUPPORTED_MODULES, useAdStageContext, useAdStageInstance };
594
+ 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 };