@adstage/web-sdk 3.0.3 → 3.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adstage/web-sdk",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
4
4
  "description": "AdStage Web SDK - Production-ready marketing platform SDK with React Provider support for seamless integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
@@ -99,7 +99,7 @@ export class DeviceInfoCollector {
99
99
  sessionId: DeviceInfoCollector.generateSessionId(),
100
100
  osVersion: DOMUtils.isBrowser() ? navigator.platform : 'SSR',
101
101
  deviceModel: DOMUtils.isBrowser() ? navigator.platform : 'SSR',
102
- appVersion: ConfigUtils.getAppVersion(), // AdStage.init()에서 설정 또는 기본값 '1.0.0'
102
+ appVersion: '1.0.0', // 기본값 (사용자가 별도 설정 필요)
103
103
  sdkVersion: getSDKVersion(), // package.json에서 동적 로드
104
104
  language: DOMUtils.isBrowser() ? (navigator.language || 'ko') : 'ko',
105
105
  country: 'KR', // 기본값
@@ -53,7 +53,6 @@ export class EventDeviceCollector {
53
53
  category: 'other',
54
54
  platform: 'SSR',
55
55
  model: 'SSR',
56
- appVersion: ConfigUtils.getAppVersion(),
57
56
  osVersion: 'SSR'
58
57
  };
59
58
  }
@@ -76,7 +75,6 @@ export class EventDeviceCollector {
76
75
  category,
77
76
  platform: platformString,
78
77
  model: navigator.platform,
79
- appVersion: ConfigUtils.getAppVersion(),
80
78
  osVersion: navigator.platform
81
79
  };
82
80
  }
@@ -107,14 +105,14 @@ export class EventDeviceCollector {
107
105
  /**
108
106
  * 사용자 제공 디바이스 정보 초기화
109
107
  */
110
- static clearUserProvidedDeviceInfo(): void {
108
+ static clearDeviceInfo(): void {
111
109
  EventDeviceCollector._userProvidedDeviceInfo = {};
112
110
  }
113
111
 
114
112
  /**
115
113
  * 현재 사용자가 설정한 디바이스 정보 반환
116
114
  */
117
- static getUserProvidedDeviceInfo(): typeof EventDeviceCollector._userProvidedDeviceInfo {
115
+ static getUserDeviceInfo(): typeof EventDeviceCollector._userProvidedDeviceInfo {
118
116
  return { ...EventDeviceCollector._userProvidedDeviceInfo };
119
117
  }
120
118
 
@@ -80,6 +80,73 @@ export class EventsModule implements BaseModule {
80
80
  return EventUserCollector.getCurrentUserProperties();
81
81
  }
82
82
 
83
+ /**
84
+ * 디바이스 정보 설정
85
+ */
86
+ setDeviceInfo(deviceInfo: Partial<{
87
+ category: 'mobile' | 'desktop' | 'tablet' | 'other';
88
+ platform: string;
89
+ model: string;
90
+ appVersion: string;
91
+ osVersion: string;
92
+ }>): void {
93
+ EventDeviceCollector.setDeviceInfo(deviceInfo);
94
+
95
+ if (this._config?.debug) {
96
+ console.log('📱 Device info set:', deviceInfo);
97
+ }
98
+ }
99
+
100
+ /**
101
+ * 개별 디바이스 속성 설정
102
+ */
103
+ setDeviceProperty(key: 'category' | 'platform' | 'model' | 'appVersion' | 'osVersion', value: string): void {
104
+ EventDeviceCollector.setDeviceProperty(key, value);
105
+
106
+ if (this._config?.debug) {
107
+ console.log('📱 Device property set:', key, value);
108
+ }
109
+ }
110
+
111
+ /**
112
+ * 사용자 제공 디바이스 정보 초기화
113
+ */
114
+ clearDeviceInfo(): void {
115
+ EventDeviceCollector.clearDeviceInfo();
116
+
117
+ if (this._config?.debug) {
118
+ console.log('📱 User provided device info cleared');
119
+ }
120
+ }
121
+
122
+ /**
123
+ * 현재 사용자가 설정한 디바이스 정보 반환
124
+ */
125
+ getUserDeviceInfo(): any {
126
+ return EventDeviceCollector.getUserDeviceInfo();
127
+ }
128
+
129
+ /**
130
+ * 현재 디바이스 정보 반환
131
+ */
132
+ getDeviceInfo(): any {
133
+ return EventDeviceCollector.getDeviceInfo();
134
+ }
135
+
136
+ /**
137
+ * 현재 사용자 정보 반환
138
+ */
139
+ getUserInfo(): any {
140
+ return EventUserCollector.getUserInfo();
141
+ }
142
+
143
+ /**
144
+ * 현재 사용자 속성 반환 (별칭)
145
+ */
146
+ getCurrentUserProperties(): any {
147
+ return EventUserCollector.getCurrentUserProperties();
148
+ }
149
+
83
150
  /**
84
151
  * 이벤트 추적
85
152
  * @param eventName 이벤트 이름
@@ -27,8 +27,7 @@ export interface AdStageConfig {
27
27
  /** 플레이스홀더 스타일 모드 (기본값: 'subtle') */
28
28
  placeholderMode?: 'invisible' | 'transparent' | 'subtle' | 'minimal' | 'debug' | 'legacy';
29
29
 
30
- /** 고객 앱 버전 (선택사항, 기본값: '1.0.0') */
31
- appVersion?: string;
30
+
32
31
  }
33
32
 
34
33
  /**
@@ -19,13 +19,7 @@ export class ConfigUtils {
19
19
  }
20
20
  }
21
21
 
22
- /**
23
- * 고객 앱 버전 반환
24
- */
25
- static getAppVersion(): string {
26
- const config = ConfigUtils.getConfig();
27
- return config?.appVersion || '1.0.0';
28
- }
22
+
29
23
 
30
24
  /**
31
25
  * 디버그 모드 여부 확인