@adstage/web-sdk 1.3.1 → 1.3.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.cjs.js CHANGED
@@ -1546,46 +1546,6 @@ class EventTracker {
1546
1546
  }
1547
1547
  return 0; // 기본값
1548
1548
  }
1549
- /**
1550
- * 커스텀 이벤트 추적
1551
- */
1552
- async trackCustomEvent(eventName, params) {
1553
- try {
1554
- // 디바이스 정보 수집
1555
- const deviceInfo = DeviceInfoCollector.collectDeviceInfo();
1556
- // 커스텀 이벤트 데이터 구성
1557
- const eventData = {
1558
- eventName,
1559
- params: params || {},
1560
- // 기본 메타데이터
1561
- userAgent: deviceInfo.userAgent,
1562
- platform: deviceInfo.platform,
1563
- screenWidth: deviceInfo.screenWidth,
1564
- screenHeight: deviceInfo.screenHeight,
1565
- deviceId: deviceInfo.deviceId,
1566
- sessionId: deviceInfo.sessionId,
1567
- timestamp: new Date().toISOString(),
1568
- // SDK 정보
1569
- sdkVersion: '1.3.1',
1570
- eventTimestamp: Date.now(),
1571
- };
1572
- // 커스텀 이벤트 API 엔드포인트로 전송
1573
- await fetch(`${this.baseUrl}/events/custom`, {
1574
- method: 'POST',
1575
- headers: {
1576
- 'x-api-key': this.apiKey,
1577
- 'Content-Type': 'application/json',
1578
- },
1579
- body: JSON.stringify(eventData),
1580
- });
1581
- if (this.debug) {
1582
- console.log(`📊 커스텀 이벤트 추적: ${eventName}`, eventData);
1583
- }
1584
- }
1585
- catch (error) {
1586
- console.error('커스텀 이벤트 추적 실패:', error);
1587
- }
1588
- }
1589
1549
  }
1590
1550
 
1591
1551
  /**
@@ -1783,25 +1743,6 @@ async function createVideoAd(containerId, options) {
1783
1743
  muted: options?.muted || true
1784
1744
  });
1785
1745
  }
1786
- /**
1787
- * 커스텀 이벤트 추적
1788
- */
1789
- function trackEvent(eventName, params) {
1790
- if (!globalSDKInstance) {
1791
- console.warn('AdStage SDK가 초기화되지 않았습니다. 이벤트 추적을 건너뜁니다.');
1792
- return;
1793
- }
1794
- try {
1795
- globalSDKInstance.trackCustomEvent(eventName, {
1796
- timestamp: new Date().toISOString(),
1797
- ...params
1798
- });
1799
- console.log(`📊 이벤트 추적: ${eventName}`, params);
1800
- }
1801
- catch (error) {
1802
- console.error('이벤트 추적 실패:', error);
1803
- }
1804
- }
1805
1746
  /**
1806
1747
  * SDK 상태 확인
1807
1748
  */
@@ -2060,23 +2001,6 @@ class AdStageSDK {
2060
2001
  getAllSlots() {
2061
2002
  return new Map(this.slots);
2062
2003
  }
2063
- /**
2064
- * 커스텀 이벤트 추적
2065
- */
2066
- trackCustomEvent(eventName, params) {
2067
- try {
2068
- this.eventTracker.trackCustomEvent(eventName, {
2069
- timestamp: new Date().toISOString(),
2070
- ...params
2071
- });
2072
- if (this.config.debug) {
2073
- console.log(`📊 커스텀 이벤트 추적: ${eventName}`, params);
2074
- }
2075
- }
2076
- catch (error) {
2077
- console.error('커스텀 이벤트 추적 실패:', error);
2078
- }
2079
- }
2080
2004
  }
2081
2005
  AdStageSDK.instance = null;
2082
2006
  async function autoInit() {
@@ -2117,8 +2041,7 @@ var index = /*#__PURE__*/Object.freeze({
2117
2041
  destroyAdStage: destroyAdStage,
2118
2042
  getAdStageInstance: getAdStageInstance,
2119
2043
  initAdStage: initAdStage,
2120
- isAdStageReady: isAdStageReady,
2121
- trackEvent: trackEvent
2044
+ isAdStageReady: isAdStageReady
2122
2045
  });
2123
2046
 
2124
2047
  exports.AdStageSDK = AdStageSDK;
@@ -2130,4 +2053,3 @@ exports.destroyAdStage = destroyAdStage;
2130
2053
  exports.getAdStageInstance = getAdStageInstance;
2131
2054
  exports.initAdStage = initAdStage;
2132
2055
  exports.isAdStageReady = isAdStageReady;
2133
- exports.trackEvent = trackEvent;
package/dist/index.d.ts CHANGED
@@ -190,10 +190,6 @@ declare function createVideoAd(containerId: string, options?: {
190
190
  autoplay?: boolean;
191
191
  muted?: boolean;
192
192
  }): Promise<void>;
193
- /**
194
- * 커스텀 이벤트 추적
195
- */
196
- declare function trackEvent(eventName: string, params?: Record<string, any>): void;
197
193
  /**
198
194
  * SDK 상태 확인
199
195
  */
@@ -292,10 +288,6 @@ declare class AdStageSDK {
292
288
  * 모든 슬롯 정보 가져오기
293
289
  */
294
290
  getAllSlots(): Map<string, AdSlot>;
295
- /**
296
- * 커스텀 이벤트 추적
297
- */
298
- trackCustomEvent(eventName: string, params?: Record<string, any>): void;
299
291
  }
300
292
 
301
- export { AdEventType, AdSlot, AdStageConfig, AdStageSDK, AdType, Advertisement, SimpleAdStageConfig, createBanner, createTextAd, createVideoAd, AdStageSDK as default, destroyAdStage, getAdStageInstance, initAdStage, isAdStageReady, trackEvent };
293
+ export { AdEventType, AdSlot, AdStageConfig, AdStageSDK, AdType, Advertisement, SimpleAdStageConfig, createBanner, createTextAd, createVideoAd, AdStageSDK as default, destroyAdStage, getAdStageInstance, initAdStage, isAdStageReady };
package/dist/index.esm.js CHANGED
@@ -1542,46 +1542,6 @@ class EventTracker {
1542
1542
  }
1543
1543
  return 0; // 기본값
1544
1544
  }
1545
- /**
1546
- * 커스텀 이벤트 추적
1547
- */
1548
- async trackCustomEvent(eventName, params) {
1549
- try {
1550
- // 디바이스 정보 수집
1551
- const deviceInfo = DeviceInfoCollector.collectDeviceInfo();
1552
- // 커스텀 이벤트 데이터 구성
1553
- const eventData = {
1554
- eventName,
1555
- params: params || {},
1556
- // 기본 메타데이터
1557
- userAgent: deviceInfo.userAgent,
1558
- platform: deviceInfo.platform,
1559
- screenWidth: deviceInfo.screenWidth,
1560
- screenHeight: deviceInfo.screenHeight,
1561
- deviceId: deviceInfo.deviceId,
1562
- sessionId: deviceInfo.sessionId,
1563
- timestamp: new Date().toISOString(),
1564
- // SDK 정보
1565
- sdkVersion: '1.3.1',
1566
- eventTimestamp: Date.now(),
1567
- };
1568
- // 커스텀 이벤트 API 엔드포인트로 전송
1569
- await fetch(`${this.baseUrl}/events/custom`, {
1570
- method: 'POST',
1571
- headers: {
1572
- 'x-api-key': this.apiKey,
1573
- 'Content-Type': 'application/json',
1574
- },
1575
- body: JSON.stringify(eventData),
1576
- });
1577
- if (this.debug) {
1578
- console.log(`📊 커스텀 이벤트 추적: ${eventName}`, eventData);
1579
- }
1580
- }
1581
- catch (error) {
1582
- console.error('커스텀 이벤트 추적 실패:', error);
1583
- }
1584
- }
1585
1545
  }
1586
1546
 
1587
1547
  /**
@@ -1779,25 +1739,6 @@ async function createVideoAd(containerId, options) {
1779
1739
  muted: options?.muted || true
1780
1740
  });
1781
1741
  }
1782
- /**
1783
- * 커스텀 이벤트 추적
1784
- */
1785
- function trackEvent(eventName, params) {
1786
- if (!globalSDKInstance) {
1787
- console.warn('AdStage SDK가 초기화되지 않았습니다. 이벤트 추적을 건너뜁니다.');
1788
- return;
1789
- }
1790
- try {
1791
- globalSDKInstance.trackCustomEvent(eventName, {
1792
- timestamp: new Date().toISOString(),
1793
- ...params
1794
- });
1795
- console.log(`📊 이벤트 추적: ${eventName}`, params);
1796
- }
1797
- catch (error) {
1798
- console.error('이벤트 추적 실패:', error);
1799
- }
1800
- }
1801
1742
  /**
1802
1743
  * SDK 상태 확인
1803
1744
  */
@@ -2056,23 +1997,6 @@ class AdStageSDK {
2056
1997
  getAllSlots() {
2057
1998
  return new Map(this.slots);
2058
1999
  }
2059
- /**
2060
- * 커스텀 이벤트 추적
2061
- */
2062
- trackCustomEvent(eventName, params) {
2063
- try {
2064
- this.eventTracker.trackCustomEvent(eventName, {
2065
- timestamp: new Date().toISOString(),
2066
- ...params
2067
- });
2068
- if (this.config.debug) {
2069
- console.log(`📊 커스텀 이벤트 추적: ${eventName}`, params);
2070
- }
2071
- }
2072
- catch (error) {
2073
- console.error('커스텀 이벤트 추적 실패:', error);
2074
- }
2075
- }
2076
2000
  }
2077
2001
  AdStageSDK.instance = null;
2078
2002
  async function autoInit() {
@@ -2113,8 +2037,7 @@ var index = /*#__PURE__*/Object.freeze({
2113
2037
  destroyAdStage: destroyAdStage,
2114
2038
  getAdStageInstance: getAdStageInstance,
2115
2039
  initAdStage: initAdStage,
2116
- isAdStageReady: isAdStageReady,
2117
- trackEvent: trackEvent
2040
+ isAdStageReady: isAdStageReady
2118
2041
  });
2119
2042
 
2120
- export { AdEventType, AdStageSDK, AdType, createBanner, createTextAd, createVideoAd, AdStageSDK as default, destroyAdStage, getAdStageInstance, initAdStage, isAdStageReady, trackEvent };
2043
+ export { AdEventType, AdStageSDK, AdType, createBanner, createTextAd, createVideoAd, AdStageSDK as default, destroyAdStage, getAdStageInstance, initAdStage, isAdStageReady };
@@ -1542,46 +1542,6 @@ class EventTracker {
1542
1542
  }
1543
1543
  return 0; // 기본값
1544
1544
  }
1545
- /**
1546
- * 커스텀 이벤트 추적
1547
- */
1548
- async trackCustomEvent(eventName, params) {
1549
- try {
1550
- // 디바이스 정보 수집
1551
- const deviceInfo = DeviceInfoCollector.collectDeviceInfo();
1552
- // 커스텀 이벤트 데이터 구성
1553
- const eventData = {
1554
- eventName,
1555
- params: params || {},
1556
- // 기본 메타데이터
1557
- userAgent: deviceInfo.userAgent,
1558
- platform: deviceInfo.platform,
1559
- screenWidth: deviceInfo.screenWidth,
1560
- screenHeight: deviceInfo.screenHeight,
1561
- deviceId: deviceInfo.deviceId,
1562
- sessionId: deviceInfo.sessionId,
1563
- timestamp: new Date().toISOString(),
1564
- // SDK 정보
1565
- sdkVersion: '1.3.1',
1566
- eventTimestamp: Date.now(),
1567
- };
1568
- // 커스텀 이벤트 API 엔드포인트로 전송
1569
- await fetch(`${this.baseUrl}/events/custom`, {
1570
- method: 'POST',
1571
- headers: {
1572
- 'x-api-key': this.apiKey,
1573
- 'Content-Type': 'application/json',
1574
- },
1575
- body: JSON.stringify(eventData),
1576
- });
1577
- if (this.debug) {
1578
- console.log(`📊 커스텀 이벤트 추적: ${eventName}`, eventData);
1579
- }
1580
- }
1581
- catch (error) {
1582
- console.error('커스텀 이벤트 추적 실패:', error);
1583
- }
1584
- }
1585
1545
  }
1586
1546
 
1587
1547
  /**
@@ -1779,25 +1739,6 @@ async function createVideoAd(containerId, options) {
1779
1739
  muted: options?.muted || true
1780
1740
  });
1781
1741
  }
1782
- /**
1783
- * 커스텀 이벤트 추적
1784
- */
1785
- function trackEvent(eventName, params) {
1786
- if (!globalSDKInstance) {
1787
- console.warn('AdStage SDK가 초기화되지 않았습니다. 이벤트 추적을 건너뜁니다.');
1788
- return;
1789
- }
1790
- try {
1791
- globalSDKInstance.trackCustomEvent(eventName, {
1792
- timestamp: new Date().toISOString(),
1793
- ...params
1794
- });
1795
- console.log(`📊 이벤트 추적: ${eventName}`, params);
1796
- }
1797
- catch (error) {
1798
- console.error('이벤트 추적 실패:', error);
1799
- }
1800
- }
1801
1742
  /**
1802
1743
  * SDK 상태 확인
1803
1744
  */
@@ -2056,23 +1997,6 @@ class AdStageSDK {
2056
1997
  getAllSlots() {
2057
1998
  return new Map(this.slots);
2058
1999
  }
2059
- /**
2060
- * 커스텀 이벤트 추적
2061
- */
2062
- trackCustomEvent(eventName, params) {
2063
- try {
2064
- this.eventTracker.trackCustomEvent(eventName, {
2065
- timestamp: new Date().toISOString(),
2066
- ...params
2067
- });
2068
- if (this.config.debug) {
2069
- console.log(`📊 커스텀 이벤트 추적: ${eventName}`, params);
2070
- }
2071
- }
2072
- catch (error) {
2073
- console.error('커스텀 이벤트 추적 실패:', error);
2074
- }
2075
- }
2076
2000
  }
2077
2001
  AdStageSDK.instance = null;
2078
2002
  async function autoInit() {
@@ -2113,8 +2037,7 @@ var index = /*#__PURE__*/Object.freeze({
2113
2037
  destroyAdStage: destroyAdStage,
2114
2038
  getAdStageInstance: getAdStageInstance,
2115
2039
  initAdStage: initAdStage,
2116
- isAdStageReady: isAdStageReady,
2117
- trackEvent: trackEvent
2040
+ isAdStageReady: isAdStageReady
2118
2041
  });
2119
2042
 
2120
- export { AdEventType, AdStageSDK, AdType, createBanner, createTextAd, createVideoAd, AdStageSDK as default, destroyAdStage, getAdStageInstance, initAdStage, isAdStageReady, trackEvent };
2043
+ export { AdEventType, AdStageSDK, AdType, createBanner, createTextAd, createVideoAd, AdStageSDK as default, destroyAdStage, getAdStageInstance, initAdStage, isAdStageReady };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adstage/web-sdk",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "AdStage Web SDK for displaying advertisements",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
package/src/index.ts CHANGED
@@ -314,23 +314,6 @@ export class AdStageSDK {
314
314
  getAllSlots(): Map<string, AdSlot> {
315
315
  return new Map(this.slots);
316
316
  }
317
-
318
- /**
319
- * 커스텀 이벤트 추적
320
- */
321
- trackCustomEvent(eventName: string, params?: Record<string, any>): void {
322
- try {
323
- this.eventTracker.trackCustomEvent(eventName, {
324
- timestamp: new Date().toISOString(),
325
- ...params
326
- });
327
- if (this.config.debug) {
328
- console.log(`📊 커스텀 이벤트 추적: ${eventName}`, params);
329
- }
330
- } catch (error) {
331
- console.error('커스텀 이벤트 추적 실패:', error);
332
- }
333
- }
334
317
  }
335
318
 
336
319
  async function autoInit() {
@@ -128,52 +128,4 @@ export class EventTracker {
128
128
 
129
129
  return 0; // 기본값
130
130
  }
131
-
132
- /**
133
- * 커스텀 이벤트 추적
134
- */
135
- async trackCustomEvent(eventName: string, params?: Record<string, any>): Promise<void> {
136
- try {
137
- // 디바이스 정보 수집
138
- const deviceInfo = DeviceInfoCollector.collectDeviceInfo();
139
-
140
- // 커스텀 이벤트 데이터 구성
141
- const eventData = {
142
- eventName,
143
- params: params || {},
144
-
145
- // 기본 메타데이터
146
- userAgent: deviceInfo.userAgent,
147
- platform: deviceInfo.platform,
148
- screenWidth: deviceInfo.screenWidth,
149
- screenHeight: deviceInfo.screenHeight,
150
- deviceId: deviceInfo.deviceId,
151
- sessionId: deviceInfo.sessionId,
152
- timestamp: new Date().toISOString(),
153
-
154
- // SDK 정보
155
- sdkVersion: '1.3.1',
156
- eventTimestamp: Date.now(),
157
- };
158
-
159
- // 커스텀 이벤트 API 엔드포인트로 전송
160
- await fetch(
161
- `${this.baseUrl}/events/custom`,
162
- {
163
- method: 'POST',
164
- headers: {
165
- 'x-api-key': this.apiKey,
166
- 'Content-Type': 'application/json',
167
- },
168
- body: JSON.stringify(eventData),
169
- }
170
- );
171
-
172
- if (this.debug) {
173
- console.log(`📊 커스텀 이벤트 추적: ${eventName}`, eventData);
174
- }
175
- } catch (error) {
176
- console.error('커스텀 이벤트 추적 실패:', error);
177
- }
178
- }
179
131
  }
@@ -121,26 +121,6 @@ export async function createVideoAd(
121
121
  });
122
122
  }
123
123
 
124
- /**
125
- * 커스텀 이벤트 추적
126
- */
127
- export function trackEvent(eventName: string, params?: Record<string, any>): void {
128
- if (!globalSDKInstance) {
129
- console.warn('AdStage SDK가 초기화되지 않았습니다. 이벤트 추적을 건너뜁니다.');
130
- return;
131
- }
132
-
133
- try {
134
- globalSDKInstance.trackCustomEvent(eventName, {
135
- timestamp: new Date().toISOString(),
136
- ...params
137
- });
138
- console.log(`📊 이벤트 추적: ${eventName}`, params);
139
- } catch (error) {
140
- console.error('이벤트 추적 실패:', error);
141
- }
142
- }
143
-
144
124
  /**
145
125
  * SDK 상태 확인
146
126
  */