@adstage/web-sdk 2.6.1 → 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/README.md +1 -1
- package/dist/index.cjs.js +580 -60
- package/dist/index.d.ts +58 -23
- package/dist/index.esm.js +577 -61
- package/dist/index.standalone.js +577 -61
- package/dist/index.umd.js +4776 -0
- package/package.json +4 -2
- package/src/constants/endpoints.ts +0 -2
- package/src/events/global-events.ts +72 -0
- package/src/example/events/README.md +125 -0
- package/src/example/events/javascript/index-esm.html +159 -0
- package/src/example/events/javascript/index.html +138 -0
- package/src/example/events/nextjs/README.md +54 -0
- package/src/example/events/nextjs/next.config.js +8 -0
- package/src/example/events/nextjs/package.json +16 -0
- package/src/example/events/nextjs/pages/_app.js +15 -0
- package/src/example/events/nextjs/pages/index.js +139 -0
- package/src/example/events/react/.env +0 -0
- package/src/example/events/react/README.md +57 -0
- package/src/example/events/react/package.json +27 -0
- package/src/example/events/react/public/index.html +11 -0
- package/src/example/events/react/src/App.js +162 -0
- package/src/example/events/react/src/index.js +6 -0
- package/src/index.ts +3 -0
- package/src/managers/device-info-collector.ts +9 -4
- package/src/managers/events/event-device-collector.ts +106 -0
- package/src/managers/events/event-session-manager.ts +183 -0
- package/src/managers/events/event-user-collector.ts +166 -0
- package/src/modules/events/events-module.ts +95 -42
- package/src/types/config.ts +3 -0
- package/src/utils/config-utils.ts +69 -0
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
|
-
* 이벤트 추적 시스템
|
|
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
|
-
|
|
426
|
+
setUserId(userId: string): void;
|
|
426
427
|
/**
|
|
427
|
-
*
|
|
428
|
-
* @example AdStage.events.pageView({ page: '/home', title: 'Homepage' })
|
|
428
|
+
* 현재 사용자 ID 반환
|
|
429
429
|
*/
|
|
430
|
-
|
|
430
|
+
getUserId(): string | undefined;
|
|
431
431
|
/**
|
|
432
|
-
*
|
|
433
|
-
* @
|
|
432
|
+
* 이벤트 추적
|
|
433
|
+
* @param eventName 이벤트 이름
|
|
434
|
+
* @param properties 이벤트 속성
|
|
434
435
|
*/
|
|
435
|
-
|
|
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
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
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 };
|