@adstage/web-sdk 1.1.0
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/LICENSE +21 -0
- package/README.md +70 -0
- package/dist/index.cjs.js +2304 -0
- package/dist/index.d.ts +416 -0
- package/dist/index.esm.js +2288 -0
- package/dist/index.standalone.js +2331 -0
- package/examples/README.md +33 -0
- package/examples/banner-ads.html +512 -0
- package/examples/index.html +338 -0
- package/examples/native-ads.html +634 -0
- package/examples/react-app/README.md +70 -0
- package/examples/react-app/index.html +13 -0
- package/examples/react-app/package-lock.json +3042 -0
- package/examples/react-app/package.json +26 -0
- package/examples/react-app/pnpm-lock.yaml +1857 -0
- package/examples/react-app/public/index.standalone.js +2331 -0
- package/examples/react-app/src/App.tsx +226 -0
- package/examples/react-app/src/index.css +37 -0
- package/examples/react-app/src/main.tsx +10 -0
- package/examples/react-app/tsconfig.json +25 -0
- package/examples/react-app/tsconfig.node.json +10 -0
- package/examples/react-app/vite.config.ts +15 -0
- package/examples/react-nextjs/app/globals.css +200 -0
- package/examples/react-nextjs/app/layout.tsx +27 -0
- package/examples/react-nextjs/app/page.tsx +258 -0
- package/examples/react-nextjs/next.config.js +9 -0
- package/examples/react-nextjs/package.json +22 -0
- package/examples/react-nextjs/pnpm-lock.yaml +343 -0
- package/examples/react-nextjs/tsconfig.json +34 -0
- package/examples/text-ads.html +597 -0
- package/examples/video-ads.html +739 -0
- package/package.json +83 -0
- package/src/global.d.ts +20 -0
- package/src/index.ts +350 -0
- package/src/managers/device-info-collector.ts +127 -0
- package/src/managers/event-tracker.ts +131 -0
- package/src/managers/fade-slider-manager.ts +276 -0
- package/src/managers/impression-tracker.ts +88 -0
- package/src/managers/slider-manager.ts +405 -0
- package/src/react/components/AdErrorBoundary.tsx +75 -0
- package/src/react/components/AdSlot.tsx +144 -0
- package/src/react/components/BannerAd.tsx +24 -0
- package/src/react/components/InterstitialAd.tsx +24 -0
- package/src/react/components/NativeAd.tsx +24 -0
- package/src/react/components/TextAd.tsx +24 -0
- package/src/react/components/VideoAd.tsx +24 -0
- package/src/react/components/index.ts +8 -0
- package/src/react/hooks/index.ts +4 -0
- package/src/react/hooks/useAdSlot.ts +83 -0
- package/src/react/hooks/useAdStage.ts +14 -0
- package/src/react/hooks/useAdTracking.ts +61 -0
- package/src/react/index.ts +4 -0
- package/src/react/providers/AdStageProvider.tsx +86 -0
- package/src/react/providers/index.ts +2 -0
- package/src/renderers/banner-renderer.ts +35 -0
- package/src/renderers/base-renderer.ts +207 -0
- package/src/renderers/index.ts +71 -0
- package/src/renderers/interstitial-renderer.ts +70 -0
- package/src/renderers/native-renderer.ts +35 -0
- package/src/renderers/text-renderer.ts +94 -0
- package/src/renderers/video-renderer.ts +63 -0
- package/src/types/advertisement.ts +197 -0
- package/src/types/api.ts +173 -0
- package/src/types/config.ts +174 -0
- package/src/types/events.ts +60 -0
- package/src/types/index.ts +6 -0
- package/src/utils/dom-utils.ts +237 -0
- package/src/utils/sdk-utils.ts +134 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 stageUp
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# AdStage Web SDK
|
|
2
|
+
|
|
3
|
+
AdStage Web SDK는 웹사이트에 광고를 쉽게 통합할 수 있는 JavaScript/TypeScript 라이브러리입니다.
|
|
4
|
+
|
|
5
|
+
## 설치
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @adstage/web-sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 사용법
|
|
12
|
+
|
|
13
|
+
### 기본 사용법
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
import { AdStageSDK, AdType } from '@adstage/web-sdk';
|
|
17
|
+
|
|
18
|
+
// SDK 초기화
|
|
19
|
+
const sdk = AdStageSDK.init({
|
|
20
|
+
apiKey: 'your-api-key',
|
|
21
|
+
debug: true
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// 광고 슬롯 생성
|
|
25
|
+
await sdk.createSlot(
|
|
26
|
+
'banner-slot-1',
|
|
27
|
+
'banner-container',
|
|
28
|
+
AdType.BANNER,
|
|
29
|
+
{
|
|
30
|
+
width: '100%',
|
|
31
|
+
height: 200
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### React 컴포넌트 사용법
|
|
37
|
+
|
|
38
|
+
```jsx
|
|
39
|
+
import { AdStageProvider, useAdStage } from '@adstage/web-sdk';
|
|
40
|
+
|
|
41
|
+
function App() {
|
|
42
|
+
return (
|
|
43
|
+
<AdStageProvider config={{ apiKey: 'your-api-key' }}>
|
|
44
|
+
<MyComponent />
|
|
45
|
+
</AdStageProvider>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function MyComponent() {
|
|
50
|
+
const { sdk, isLoading, isInitialized } = useAdStage();
|
|
51
|
+
|
|
52
|
+
// SDK 사용...
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## 지원하는 광고 타입
|
|
57
|
+
|
|
58
|
+
- BANNER: 배너 광고
|
|
59
|
+
- SLIDER: 슬라이더 광고
|
|
60
|
+
- TEXT: 텍스트 광고
|
|
61
|
+
- NATIVE: 네이티브 광고
|
|
62
|
+
- VIDEO: 비디오 광고
|
|
63
|
+
|
|
64
|
+
## 라이센스
|
|
65
|
+
|
|
66
|
+
MIT
|
|
67
|
+
|
|
68
|
+
## 지원
|
|
69
|
+
|
|
70
|
+
문의사항이 있으시면 [GitHub Issues](https://github.com/nbase-io/adstage/issues)에 등록해주세요.
|