@adstage/web-sdk 2.4.2 → 2.4.4

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
@@ -3371,21 +3371,22 @@ function AdStageProvider({ children, config }) {
3371
3371
  * AdStage Context Hook
3372
3372
  * AdStageProvider 내에서 SDK 상태에 접근할 수 있습니다.
3373
3373
  */
3374
- function useAdStage() {
3374
+ function useAdStageContext() {
3375
3375
  const context = react.useContext(AdStageContext);
3376
3376
  if (!context) {
3377
- throw new Error('useAdStage must be used within an AdStageProvider');
3377
+ throw new Error('useAdStageContext must be used within an AdStageProvider');
3378
3378
  }
3379
3379
  return context;
3380
3380
  }
3381
3381
  /**
3382
- * AdStage SDK Hook
3382
+ * AdStage Instance Hook
3383
3383
  * 초기화된 AdStage 인스턴스에 직접 접근할 수 있습니다.
3384
3384
  */
3385
- function useAdStageSDK() {
3386
- const { isInitialized } = useAdStage();
3385
+ function useAdStageInstance() {
3386
+ const { isInitialized } = useAdStageContext();
3387
3387
  if (!isInitialized) {
3388
- throw new Error('AdStage SDK is not initialized. Please call initialize() first or provide config to AdStageProvider.');
3388
+ console.warn('AdStage SDK is not initialized. Please call initialize() first or provide config to AdStageProvider.');
3389
+ return null;
3389
3390
  }
3390
3391
  return AdStage;
3391
3392
  }
@@ -3403,4 +3404,5 @@ exports.AdStage = AdStage;
3403
3404
  exports.AdStageProvider = AdStageProvider;
3404
3405
  exports.SDK_VERSION = SDK_VERSION;
3405
3406
  exports.SUPPORTED_MODULES = SUPPORTED_MODULES;
3406
- exports.useAdStage = useAdStageSDK;
3407
+ exports.useAdStageContext = useAdStageContext;
3408
+ exports.useAdStageInstance = useAdStageInstance;
package/dist/index.d.ts CHANGED
@@ -486,6 +486,13 @@ declare class AdStage {
486
486
  static reset(): void;
487
487
  }
488
488
 
489
+ interface AdStageContextType {
490
+ isInitialized: boolean;
491
+ config: AdStageConfig | null;
492
+ initialize: (config: AdStageConfig) => void;
493
+ reset: () => void;
494
+ error: string | null;
495
+ }
489
496
  interface AdStageProviderProps {
490
497
  children: ReactNode;
491
498
  /**
@@ -496,10 +503,15 @@ interface AdStageProviderProps {
496
503
  }
497
504
  declare function AdStageProvider({ children, config }: AdStageProviderProps): react_jsx_runtime.JSX.Element;
498
505
  /**
499
- * AdStage SDK Hook
506
+ * AdStage Context Hook
507
+ * AdStageProvider 내에서 SDK 상태에 접근할 수 있습니다.
508
+ */
509
+ declare function useAdStageContext(): AdStageContextType;
510
+ /**
511
+ * AdStage Instance Hook
500
512
  * 초기화된 AdStage 인스턴스에 직접 접근할 수 있습니다.
501
513
  */
502
- declare function useAdStageSDK(): typeof AdStage;
514
+ declare function useAdStageInstance(): typeof AdStage | null;
503
515
 
504
516
  /**
505
517
  * AdStage Web SDK
@@ -509,4 +521,4 @@ declare function useAdStageSDK(): typeof AdStage;
509
521
  declare const SDK_VERSION = "2.0.0";
510
522
  declare const SUPPORTED_MODULES: readonly ["ads", "events", "config"];
511
523
 
512
- export { AdEventType, AdOptions, AdSlot, AdStage, AdStageConfig, AdStageProvider, AdType, Advertisement, ApiResponse, BaseModule, EventProperties, ModuleName, OrganizationInfo, PageData, SDK_VERSION, SUPPORTED_MODULES, useAdStageSDK as useAdStage };
524
+ export { AdEventType, AdOptions, AdSlot, AdStage, AdStageConfig, AdStageProvider, AdType, Advertisement, ApiResponse, BaseModule, EventProperties, ModuleName, OrganizationInfo, PageData, SDK_VERSION, SUPPORTED_MODULES, useAdStageContext, useAdStageInstance };
package/dist/index.esm.js CHANGED
@@ -3369,21 +3369,22 @@ function AdStageProvider({ children, config }) {
3369
3369
  * AdStage Context Hook
3370
3370
  * AdStageProvider 내에서 SDK 상태에 접근할 수 있습니다.
3371
3371
  */
3372
- function useAdStage() {
3372
+ function useAdStageContext() {
3373
3373
  const context = useContext(AdStageContext);
3374
3374
  if (!context) {
3375
- throw new Error('useAdStage must be used within an AdStageProvider');
3375
+ throw new Error('useAdStageContext must be used within an AdStageProvider');
3376
3376
  }
3377
3377
  return context;
3378
3378
  }
3379
3379
  /**
3380
- * AdStage SDK Hook
3380
+ * AdStage Instance Hook
3381
3381
  * 초기화된 AdStage 인스턴스에 직접 접근할 수 있습니다.
3382
3382
  */
3383
- function useAdStageSDK() {
3384
- const { isInitialized } = useAdStage();
3383
+ function useAdStageInstance() {
3384
+ const { isInitialized } = useAdStageContext();
3385
3385
  if (!isInitialized) {
3386
- throw new Error('AdStage SDK is not initialized. Please call initialize() first or provide config to AdStageProvider.');
3386
+ console.warn('AdStage SDK is not initialized. Please call initialize() first or provide config to AdStageProvider.');
3387
+ return null;
3387
3388
  }
3388
3389
  return AdStage;
3389
3390
  }
@@ -3397,4 +3398,4 @@ function useAdStageSDK() {
3397
3398
  const SDK_VERSION = '2.0.0';
3398
3399
  const SUPPORTED_MODULES = ['ads', 'events', 'config'];
3399
3400
 
3400
- export { AdStage, AdStageProvider, SDK_VERSION, SUPPORTED_MODULES, useAdStageSDK as useAdStage };
3401
+ export { AdStage, AdStageProvider, SDK_VERSION, SUPPORTED_MODULES, useAdStageContext, useAdStageInstance };
@@ -3441,21 +3441,22 @@ function AdStageProvider({ children, config }) {
3441
3441
  * AdStage Context Hook
3442
3442
  * AdStageProvider 내에서 SDK 상태에 접근할 수 있습니다.
3443
3443
  */
3444
- function useAdStage() {
3444
+ function useAdStageContext() {
3445
3445
  const context = reactExports.useContext(AdStageContext);
3446
3446
  if (!context) {
3447
- throw new Error('useAdStage must be used within an AdStageProvider');
3447
+ throw new Error('useAdStageContext must be used within an AdStageProvider');
3448
3448
  }
3449
3449
  return context;
3450
3450
  }
3451
3451
  /**
3452
- * AdStage SDK Hook
3452
+ * AdStage Instance Hook
3453
3453
  * 초기화된 AdStage 인스턴스에 직접 접근할 수 있습니다.
3454
3454
  */
3455
- function useAdStageSDK() {
3456
- const { isInitialized } = useAdStage();
3455
+ function useAdStageInstance() {
3456
+ const { isInitialized } = useAdStageContext();
3457
3457
  if (!isInitialized) {
3458
- throw new Error('AdStage SDK is not initialized. Please call initialize() first or provide config to AdStageProvider.');
3458
+ console.warn('AdStage SDK is not initialized. Please call initialize() first or provide config to AdStageProvider.');
3459
+ return null;
3459
3460
  }
3460
3461
  return AdStage;
3461
3462
  }
@@ -3469,4 +3470,4 @@ function useAdStageSDK() {
3469
3470
  const SDK_VERSION = '2.0.0';
3470
3471
  const SUPPORTED_MODULES = ['ads', 'events', 'config'];
3471
3472
 
3472
- export { AdStage, AdStageProvider, SDK_VERSION, SUPPORTED_MODULES, useAdStageSDK as useAdStage };
3473
+ export { AdStage, AdStageProvider, SDK_VERSION, SUPPORTED_MODULES, useAdStageContext, useAdStageInstance };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adstage/web-sdk",
3
- "version": "2.4.2",
3
+ "version": "2.4.4",
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",
package/src/index.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  export { default as AdStage } from './core/AdStage';
8
8
 
9
9
  // React 통합
10
- export { AdStageProvider, useAdStage } from './react';
10
+ export { AdStageProvider, useAdStageContext, useAdStageInstance } from './react';
11
11
 
12
12
  // 설정 및 타입
13
13
  export type { AdStageConfig, ModuleName, BaseModule, ApiResponse, OrganizationInfo } from './types/config';
@@ -94,23 +94,24 @@ export function AdStageProvider({ children, config }: AdStageProviderProps) {
94
94
  * AdStage Context Hook
95
95
  * AdStageProvider 내에서 SDK 상태에 접근할 수 있습니다.
96
96
  */
97
- export function useAdStage(): AdStageContextType {
97
+ export function useAdStageContext(): AdStageContextType {
98
98
  const context = useContext(AdStageContext);
99
99
  if (!context) {
100
- throw new Error('useAdStage must be used within an AdStageProvider');
100
+ throw new Error('useAdStageContext must be used within an AdStageProvider');
101
101
  }
102
102
  return context;
103
103
  }
104
104
 
105
105
  /**
106
- * AdStage SDK Hook
106
+ * AdStage Instance Hook
107
107
  * 초기화된 AdStage 인스턴스에 직접 접근할 수 있습니다.
108
108
  */
109
- export function useAdStageSDK() {
110
- const { isInitialized } = useAdStage();
109
+ export function useAdStageInstance() {
110
+ const { isInitialized } = useAdStageContext();
111
111
 
112
112
  if (!isInitialized) {
113
- throw new Error('AdStage SDK is not initialized. Please call initialize() first or provide config to AdStageProvider.');
113
+ console.warn('AdStage SDK is not initialized. Please call initialize() first or provide config to AdStageProvider.');
114
+ return null;
114
115
  }
115
116
 
116
117
  return AdStage;
@@ -3,7 +3,7 @@
3
3
  * React 애플리케이션을 위한 컴포넌트와 훅들
4
4
  */
5
5
 
6
- export { AdStageProvider, useAdStage as useAdStageContext, useAdStageSDK as useAdStage } from './AdStageProvider';
6
+ export { AdStageProvider, useAdStageContext, useAdStageInstance } from './AdStageProvider';
7
7
 
8
8
  // 타입들도 재export
9
9
  export type { AdStageConfig, ModuleName, BaseModule } from '../types/config';