@ai-ad-network/frontend-sdk 1.0.7 → 1.0.9

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.
Files changed (44) hide show
  1. package/README.md +242 -282
  2. package/dist/client-info/collector.d.ts +123 -0
  3. package/dist/client-info/index.d.ts +21 -0
  4. package/dist/client-info/utils.d.ts +151 -0
  5. package/dist/components/ActionCardAd.d.ts +26 -0
  6. package/dist/components/AdAnalytics.d.ts +65 -0
  7. package/dist/components/AdErrorBoundary.d.ts +86 -0
  8. package/dist/components/AdProvider.d.ts +121 -0
  9. package/dist/components/AdSkeleton.d.ts +50 -0
  10. package/dist/components/EnhancedContent.d.ts +53 -0
  11. package/dist/components/FollowUpAd.d.ts +53 -0
  12. package/dist/components/LeadGenAd.d.ts +52 -0
  13. package/dist/components/SponsoredSource.d.ts +62 -0
  14. package/dist/components/StaticAd.d.ts +114 -0
  15. package/dist/components/SuffixAd.d.ts +34 -0
  16. package/dist/hooks/useAdSlots.d.ts +179 -0
  17. package/dist/hooks/useAdTracking.d.ts +59 -0
  18. package/dist/hooks/useAiAds.d.ts +54 -0
  19. package/dist/index.d.ts +52 -0
  20. package/dist/index.esm.js +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/lib/cn.d.ts +6 -0
  23. package/dist/mockData.d.ts +58 -0
  24. package/dist/types/index.d.ts +670 -0
  25. package/dist/universal/index.d.ts +2169 -0
  26. package/dist/universal/universal.cjs.js +3634 -0
  27. package/dist/universal/universal.cjs.js.map +1 -0
  28. package/dist/universal/universal.esm.js +3634 -0
  29. package/dist/universal/universal.esm.js.map +1 -0
  30. package/dist/universal/universal.iife.js +3637 -0
  31. package/dist/universal/universal.iife.js.map +1 -0
  32. package/dist/universal/universal.umd.js +3638 -0
  33. package/dist/universal/universal.umd.js.map +1 -0
  34. package/dist/utils/text-weaver.d.ts +49 -0
  35. package/dist/utils/tracking.d.ts +34 -0
  36. package/dist/version.d.ts +1 -0
  37. package/docs/AD_FORMATS.md +815 -0
  38. package/docs/QUICK_START.md +547 -359
  39. package/docs/UNIVERSAL_SDK_GUIDE.md +451 -3
  40. package/package.json +15 -14
  41. package/INTEGRATION_CHECKLIST.md +0 -175
  42. package/docs/CLIENT_INFO_COLLECTION.md +0 -880
  43. package/docs/COMPONENT_DOCUMENTATION.md +0 -671
  44. package/docs/README.md +0 -348
package/README.md CHANGED
@@ -2,19 +2,23 @@
2
2
 
3
3
  > 🚀 **Zero-config** SDK for AI-powered native ads with automatic client info collection
4
4
  >
5
- > 📦 **Dual Support**: React SDK + Universal Framework-Agnostic SDK
5
+ > **📦 Dual Support**: React SDK + Universal Framework-Agnostic SDK
6
+ >
7
+ > **Version**: 1.0.7
8
+
9
+ ---
6
10
 
7
- ## 🎯 Choose Your Integration
11
+ ## 🎯 Choose Your SDK
8
12
 
9
- ### React Projects (Original SDK)
13
+ ### React Projects
10
14
  ```bash
11
15
  npm install @ai-ad-network/frontend-sdk
12
16
  ```
13
17
  ```tsx
14
- import { AdProvider, useAiAds } from '@ai-ad-network/frontend-sdk';
18
+ import { AdProvider, useAiAds, ActionCardAd } from '@ai-ad-network/frontend-sdk';
15
19
  ```
16
20
 
17
- ### Any Other Framework (Universal SDK) NEW
21
+ ### Other Frameworks (Vue, Angular, Vanilla JS, etc.)
18
22
  ```bash
19
23
  npm install @ai-ad-network/frontend-sdk
20
24
  ```
@@ -22,119 +26,154 @@ npm install @ai-ad-network/frontend-sdk
22
26
  import { AdManager, DOMRenderer } from '@ai-ad-network/frontend-sdk/universal';
23
27
  ```
24
28
 
25
- **Universal SDK Works With:**
26
- - ✅ Vanilla JavaScript
27
- - ✅ Vue 2 & 3
28
- - ✅ Angular
29
- - ✅ Svelte
30
- - ✅ SolidJS
31
- - ✅ Any other framework
29
+ **Universal SDK Works With**: Vue 2/3, Angular, Svelte, SolidJS, Vanilla JS, or any other framework
32
30
 
33
- 📖 **[Universal SDK Guide](./docs/UNIVERSAL_SDK_GUIDE.md)** for non-React frameworks
31
+ ---
34
32
 
35
33
  ## ✨ Key Features
36
34
 
37
35
  - 🎯 **Intent-based Ad Delivery** - Ads matched to user intent
38
- - 🎨 **Native Ad Formats** - Action Cards, Suffix, Follow-up, Sponsored Sources
36
+ - 🎨 **Native Ad Formats** - Action Cards, Suffix, Follow-up, Sponsored Sources, Lead Gen
39
37
  - 📊 **Built-in Analytics** - Impression and click tracking
40
38
  - ⚡ **Optimized Performance** - SWR caching, Intersection Observer
41
39
  - 🎭 **Headless Design** - Full customization with CSS variables
42
40
  - 📱 **Responsive** - Works on all screen sizes
43
- - 🔐 **Built-in Authentication** - API key support for secure access
44
- - 🌐 **OpenRTB Compliant** - **Zero-config** auto-collection of device/app/user/geo info
41
+ - 🔐 **Built-in Authentication** - API key support
42
+ - 🌐 **OpenRTB Compliant** - **Zero-config** auto-collection of device/app/user/geo info
43
+ - 🌐 **Framework-Agnostic** - Works with ANY frontend framework
44
+
45
+ ---
46
+
47
+ ## 🚀 Quick Start
45
48
 
46
- ## 🚀 Zero-Config ClientInfo Collection
49
+ ### React (3 Steps)
47
50
 
48
- **No manual setup required!** The SDK automatically collects and injects OpenRTB-compliant client information:
51
+ **Step 1: Install**
52
+ ```bash
53
+ npm install @ai-ad-network/frontend-sdk
54
+ ```
49
55
 
56
+ **Step 2: Wrap App**
50
57
  ```tsx
51
- import { useAdSlots } from '@ai-ad-network/frontend-sdk';
58
+ import { AdProvider } from '@ai-ad-network/frontend-sdk';
52
59
 
53
- function ChatApp() {
54
- const { requestAds } = useAdSlots({
55
- apiBaseUrl: '/api/v1',
56
- slots: [/* your slots */],
57
- enabled: true,
58
- });
60
+ function App() {
61
+ return (
62
+ <AdProvider config={{ apiBaseUrl: '/api/v1', apiKey: 'ak_your_key' }}>
63
+ <ChatApp />
64
+ </AdProvider>
65
+ );
66
+ }
67
+ ```
59
68
 
60
- // ClientInfo is AUTOMATICALLY collected and injected!
61
- await requestAds({
62
- conversationContext: { query, response },
63
- userContext: { sessionId },
69
+ **Step 3: Use Ads**
70
+ ```tsx
71
+ import { useAiAds, ActionCardAd } from '@ai-ad-network/frontend-sdk';
72
+
73
+ function ChatApp() {
74
+ const { ads } = useAiAds(query, response, isFinished, {
75
+ formats: ['action_card', 'suffix'],
64
76
  });
65
77
 
66
- // Request payload automatically includes:
67
- // {
68
- // conversationContext: {...},
69
- // userContext: {...},
70
- // clientInfo: { // ← Zero-config! Auto-collected!
71
- // device: { os, model, screen... },
72
- // app: { bundle, name, version... },
73
- // user: { id, consent... },
74
- // geo: { country, language... }
75
- // }
76
- // }
78
+ return ads.map(ad => <ActionCardAd key={ad.id} ad={ad} />);
77
79
  }
78
80
  ```
79
81
 
80
- **What's auto-collected:**
81
- - 🖥️ **Device Info**: OS, model, screen size, language
82
- - 📱 **App Info**: Bundle ID, name, version (inferred from page)
83
- - 👤 **User Info**: Unique ID (auto-generated & persistent)
84
- - 🌍 **Geo Info**: Country, language (from timezone/locale)
82
+ ### Universal / Other Frameworks (3 Steps)
85
83
 
86
- 📖 **See [ClientInfo Documentation](./docs/CLIENT_INFO_COLLECTION.md)**
84
+ **Step 1: Install**
85
+ ```bash
86
+ npm install @ai-ad-network/frontend-sdk
87
+ ```
87
88
 
88
- ---
89
+ **Step 2: Import**
90
+ ```javascript
91
+ import { AdManager, DOMRenderer } from '@ai-ad-network/frontend-sdk/universal';
92
+ // or CDN: <script src="universal.iife.js"></script>
93
+ ```
94
+
95
+ **Step 3: Use**
96
+ ```javascript
97
+ const adManager = new AdManager({
98
+ apiBaseUrl: '/api/v1',
99
+ slots: [{ slotId: 'banner', position: 'top', adTypes: ['action-card'] }]
100
+ });
101
+
102
+ const result = await adManager.requestAds({
103
+ conversationContext: { topic: 'tech', messages: [] }
104
+ });
105
+
106
+ DOMRenderer.renderActionCard(result.slots[0].ad, container);
107
+ ```
89
108
 
90
- ## 🆕 ClientInfo API ⭐ NEW
109
+ ---
91
110
 
92
- **Direct access to client information for your own use!**
111
+ ## 🆕 ClientInfo API
93
112
 
94
- The SDK now exposes convenient functions to access client info for analytics, personalization, A/B testing, and more.
113
+ **Direct access to client information for analytics, personalization, A/B testing, and more!**
95
114
 
96
115
  ```typescript
97
116
  // React SDK
98
117
  import { getUserId, getDeviceInfo, getClientInfo } from '@ai-ad-network/frontend-sdk';
99
118
 
100
- // Universal SDK (Vue, Angular, etc.)
119
+ // Universal SDK
101
120
  import { getUserId, getDeviceInfo, getClientInfo } from '@ai-ad-network/frontend-sdk/universal';
102
121
 
103
- // Get user ID for analytics
104
- const userId = getUserId();
105
- analytics.identify(userId);
106
-
107
- // Get device info for conditional features
108
- const device = getDeviceInfo();
109
- if (device.devicetype === 1) {
110
- // Mobile - enable mobile optimizations
111
- } else {
112
- // Desktop - enable desktop features
113
- }
114
-
115
- // Get complete info for personalization
116
- const info = getClientInfo();
117
- if (info.geo?.country === 'CN') {
118
- loadChinesePaymentMethods();
119
- }
122
+ // CDN
123
+ const userId = window.AiAdNetwork.getUserId();
120
124
  ```
121
125
 
122
126
  **Available Functions:**
123
- - `getClientInfo()` - Get complete client information
124
- - `getUserId()` - Get persistent user ID
125
- - `getDeviceInfo()` - Get device info only
126
- - `getUserInfo()` - Get user info only
127
- - `getAppInfo()` - Get app info only
128
- - `getGeoInfo()` - Get geo info only
129
- - `getClientInfoJSON()` - Get as JSON string
130
- - `getClientInfoSummary()` - Get human-readable summary
127
+ - `getClientInfo()` - Complete client information
128
+ - `getUserId()` - Persistent user ID
129
+ - `getDeviceInfo()` - Device info only
130
+ - `getUserInfo()` - User info only
131
+ - `getAppInfo()` - App info only
132
+ - `getGeoInfo()` - Geo info only
133
+ - `getClientInfoJSON()` - As JSON string
134
+ - `getClientInfoSummary()` - Human-readable summary
131
135
  - `clearClientInfoCache()` - Force re-collection
132
136
 
133
- 📖 **[Universal SDK Guide - ClientInfo API](./docs/UNIVERSAL_SDK_GUIDE.md#clientinfo-api--new)**
137
+ **Use Cases:**
138
+ - 📊 **Analytics**: `analytics.identify(getUserId())`
139
+ - 🌍 **Localization**: `if (getGeoInfo()?.country === 'CN') { ... }`
140
+ - 🧪 **A/B Testing**: `const variant = getUserId() % 2 === 0 ? 'A' : 'B'`
141
+ - 📱 **Conditional**: `if (getDeviceInfo().devicetype === 1) { /* mobile */ }`
142
+
143
+ ---
144
+
145
+ ## 🔑 Zero-Config ClientInfo Collection
146
+
147
+ **No manual setup required!** The SDK automatically collects and injects:
148
+
149
+ - 🖥️ **Device Info**: OS, model, screen size, language
150
+ - 📱 **App Info**: Bundle ID, name, version (inferred from page)
151
+ - 👤 **User Info**: Unique persistent ID (auto-generated)
152
+ - 🌍 **Geo Info**: Country, language (from timezone/locale)
153
+
154
+ ```typescript
155
+ // ClientInfo is AUTOMATICALLY collected and injected!
156
+ await requestAds({
157
+ conversationContext: { query, response },
158
+ userContext: { sessionId },
159
+ });
160
+
161
+ // Request payload includes:
162
+ // {
163
+ // conversationContext: {...},
164
+ // userContext: {...},
165
+ // clientInfo: { // ← Auto-collected!
166
+ // device: { os, model, screen... },
167
+ // app: { bundle, name, version... },
168
+ // user: { id, consent... },
169
+ // geo: { country, language... }
170
+ // }
171
+ // }
172
+ ```
134
173
 
135
- 📖 **See [Quick Start Guide](./docs/QUICK_START.md) for complete integration docs.**
174
+ ---
136
175
 
137
- ## Installation
176
+ ## 📦 Installation
138
177
 
139
178
  ```bash
140
179
  npm install @ai-ad-network/frontend-sdk
@@ -144,251 +183,172 @@ yarn add @ai-ad-network/frontend-sdk
144
183
  pnpm add @ai-ad-network/frontend-sdk
145
184
  ```
146
185
 
147
- ## Quick Start
186
+ **Build Outputs:**
187
+ - React SDK: `dist/index.js`, `dist/index.esm.js`
188
+ - Universal SDK: `dist/universal/universal.*.js` (ES, CJS, UMD, IIFE)
148
189
 
149
- ```tsx
150
- import { AdProvider, useAiAds, ActionCardAd } from '@ai-ad-network/frontend-sdk';
151
-
152
- function App() {
153
- return (
154
- <AdProvider
155
- config={{
156
- apiBaseUrl: 'https://your-ad-network.com/api/v1',
157
- apiKey: 'ak_your_tenant_your_key', // Get from admin
158
- debug: process.env.NODE_ENV === 'development',
159
- }}
160
- >
161
- <ChatApp />
162
- </AdProvider>
163
- );
164
- }
165
-
166
- function ChatApp() {
167
- const [query, setQuery] = useState('');
168
- const [response, setResponse] = useState('');
169
- const [isFinished, setIsFinished] = useState(false);
190
+ ---
170
191
 
171
- const { ads, isLoading } = useAiAds(query, response, isFinished, {
172
- formats: ['action_card', 'suffix'],
173
- placement: 'post_response',
174
- });
192
+ ## 📚 Documentation
175
193
 
176
- return (
177
- <div>
178
- {/* Your chat UI */}
179
- {ads.map(ad => (
180
- <ActionCardAd key={ad.id} ad={ad} />
181
- ))}
182
- </div>
183
- );
184
- }
185
- ```
194
+ - 📖 **[Quick Start Guide](./docs/QUICK_START.md)** - Get started in 3 minutes
195
+ - 📖 **[Universal SDK Guide](./docs/UNIVERSAL_SDK_GUIDE.md)** - Framework-agnostic SDK docs
186
196
 
187
- ## Configuration
197
+ **Universal SDK Guide includes:**
198
+ - AdManager API reference
199
+ - DOMRenderer and HTMLRenderer usage
200
+ - Web Components examples
201
+ - Vue/Angular/Vanilla JS integration
202
+ - ClientInfo API reference
203
+ - CDN usage
188
204
 
189
- ### AdProvider Props
205
+ ---
190
206
 
191
- ```tsx
192
- <AdProvider
193
- config={{
194
- // API Configuration
195
- apiBaseUrl?: string; // Default: '/api/v1'
196
- apiKey?: string; // Your API key (format: ak_tenant_key)
197
-
198
- // Ad Behavior
199
- defaultFormats?: string[]; // Default: ['action_card', 'suffix']
200
- defaultPlacement?: string; // Default: 'post_response'
201
- enabled?: boolean; // Default: true
202
-
203
- // Debugging
204
- debug?: boolean; // Default: false
205
- headers?: Record<string, string>;
206
-
207
- // Performance
208
- timeout?: number; // Default: 5000
209
- maxRetries?: number; // Default: 2
210
-
211
- // Tracking
212
- userId?: string;
213
- }}
214
- >
215
- {children}
216
- </AdProvider>
217
- ```
207
+ ## 🎨 Available Ad Formats
218
208
 
219
- ## Components
209
+ ### React Components
210
+ - **ActionCardAd** - Product cards (horizontal/vertical/compact)
211
+ - **SuffixAd** - Inline message enhancements (block/inline/minimal)
212
+ - **FollowUpAd** - Follow-up questions (bubble/pill/underline)
213
+ - **SponsoredSource** - Sponsored content sources (card/minimal)
214
+ - **LeadGenAd** - Lead generation forms
215
+ - **StaticAd** - Traditional banner ads
220
216
 
221
- ### ActionCardAd
217
+ ### Universal Renderers
218
+ - `DOMRenderer.renderActionCard()`
219
+ - `DOMRenderer.renderSuffixAd()`
220
+ - `DOMRenderer.renderSponsoredSource()`
221
+ - `DOMRenderer.renderLeadGenAd()`
222
222
 
223
- Rich media card for product ads.
223
+ ### Web Components (Framework-Agnostic)
224
+ - `<ad-action-card>`
225
+ - `<ad-suffix>`
226
+ - `<ad-sponsored-source>`
227
+ - `<ad-lead-gen>`
224
228
 
225
- ```tsx
226
- <ActionCardAd
227
- ad={ad}
228
- variant="horizontal" // 'horizontal' | 'vertical' | 'compact'
229
- onClick={() => console.log('Clicked!')}
230
- />
231
- ```
229
+ ---
232
230
 
233
- ### SuffixAd
231
+ ## ⚡ Performance & Optimization
234
232
 
235
- Text-based ad appended to AI responses.
233
+ - **SWR Caching** - Smart request deduplication
234
+ - ✅ **Intersection Observer** - Lazy impression tracking
235
+ - ✅ **Event Batching** - Optimized re-renders
236
+ - ✅ **Code Splitting** - Tree-shakeable exports
237
+ - ✅ **TypeScript** - Full type definitions
238
+ - ✅ **Zero Runtime Overhead** - Minimal bundle size
236
239
 
237
- ```tsx
238
- <SuffixAd
239
- ad={ad}
240
- aiContext={aiResponse}
241
- variant="block" // 'block' | 'inline' | 'minimal'
242
- />
243
- ```
240
+ ---
244
241
 
245
- ### FollowUpAd
242
+ ## 🎨 Styling & Customization
246
243
 
247
- Ad disguised as a follow-up question.
244
+ ### CSS Variables
248
245
 
249
- ```tsx
250
- <FollowUpAd
251
- ad={ad}
252
- variant="bubble" // 'bubble' | 'pill' | 'underline'
253
- />
254
-
255
- // Or mix with regular questions
256
- <FollowUpAdMixed
257
- questions={['How does it work?', 'What are the features?']}
258
- ad={ad}
259
- adPosition={1}
260
- onQuestionClick={(q) => console.log(q)}
261
- />
246
+ ```css
247
+ :root {
248
+ /* Card styling */
249
+ --ai-ad-card-bg: #ffffff;
250
+ --ai-ad-card-border: #e5e7eb;
251
+ --ai-ad-card-border-radius: 12px;
252
+ --ai-ad-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
253
+
254
+ /* Typography */
255
+ --ai-ad-title-color: #111827;
256
+ --ai-ad-body-color: #6b7280;
257
+ --ai-ad-cta-bg: #10b981;
258
+ --ai-ad-cta-color: #ffffff;
259
+
260
+ /* Spacing */
261
+ --ai-ad-padding: 16px;
262
+ --ai-ad-gap: 12px;
263
+ }
262
264
  ```
263
265
 
264
- ### SponsoredSource
266
+ ---
265
267
 
266
- Ad in citation/source list format.
268
+ ## 📊 Examples
267
269
 
268
- ```tsx
269
- <SponsoredSource
270
- ad={ad}
271
- variant="card" // 'card' | 'list-item' | 'minimal'
272
- />
273
-
274
- // Or mix with regular sources
275
- <SourceListWithAds
276
- sources={[{ title: 'Wikipedia', url: '...' }]}
277
- ad={ad}
278
- adPosition={1}
279
- />
280
- ```
270
+ ### Examples Directory
281
271
 
282
- ## Hooks
272
+ - `examples/vanilla-js.html` - Complete Vanilla JS demo
273
+ - `examples/vue-example.js` - Vue 3 integration
274
+ - `examples/client-info-usage.ts` - ClientInfo API examples
275
+ - `examples/client-info-demo.html` - Interactive ClientInfo demo
283
276
 
284
- ### useAiAds
277
+ ---
285
278
 
286
- Main hook for fetching ads.
279
+ ## ⚠️ Troubleshooting
287
280
 
288
- ```tsx
289
- const {
290
- ads, // Array of KoahAd objects
291
- intent, // Intent analysis result
292
- routing, // Routing information
293
- isLoading, // Loading state
294
- error, // Error object
295
- refetch, // Manual refetch function
296
- } = useAiAds(
297
- userQuery, // User's question
298
- aiResponse, // AI's response
299
- isStreamFinished, // Boolean
300
- {
301
- enabled: true,
302
- formats: ['action_card', 'suffix'],
303
- placement: 'post_response',
304
- apiBaseUrl: '/api/v1',
305
- }
306
- );
307
- ```
281
+ ### Ads not showing?
308
282
 
309
- ### useAdTracking
283
+ 1. ✅ Console shows SDK v1.0.7+
284
+ 2. ✅ `apiBaseUrl` is correct
285
+ 3. ✅ `apiKey` is valid
286
+ 4. ✅ Network requests succeed (DevTools → Network)
310
287
 
311
- Tracking hook for impressions and clicks.
288
+ ### Console shows old version?
312
289
 
313
- ```tsx
314
- const {
315
- impressionRef, // Ref to attach to ad element
316
- handleClick, // Click handler
317
- hasImpressed, // Boolean
318
- isIntersecting, // Boolean
319
- } = useAdTracking(ad, {
320
- intersectionThreshold: 0.5,
321
- minViewTimeMs: 1000,
322
- onClick: () => console.log('Clicked'),
323
- onImpression: () => console.log('Viewed'),
324
- });
290
+ ```bash
291
+ rm -rf node_modules package-lock.json
292
+ npm install @ai-ad-network/frontend-sdk@latest
325
293
  ```
326
294
 
327
- ## Styling
295
+ ### ClientInfo not in request?
328
296
 
329
- ### CSS Variables
297
+ - **React**: Check if using `useAdSlots` or `useAiAds`
298
+ - **Universal**: Check if using `AdManager`
299
+ - Console should show `[SDK] ClientInfo collection: ENABLED`
330
300
 
331
- Customize the appearance with CSS variables:
301
+ ---
332
302
 
333
- ```css
334
- :root {
335
- --ad-primary: #3b82f6;
336
- --ad-secondary: #8b5cf6;
337
- --ad-background: #f8fafc;
338
- --ad-border: #e2e8f0;
339
- --ad-text: #1e293b;
340
- --ad-sponsored: #94a3b8;
341
- }
342
- ```
303
+ ## ✅ Integration Checklist
343
304
 
344
- ### Utility Function
305
+ - [ ] SDK installed (`npm install @ai-ad-network/frontend-sdk`)
306
+ - [ ] Console shows version v1.0.7+
307
+ - [ ] React: App wrapped with `AdProvider`
308
+ - [ ] Universal: `AdManager` initialized
309
+ - [ ] Console shows ClientInfo collected
310
+ - [ ] Network requests include `clientInfo` field
311
+ - [ ] Ads are rendering
312
+ - [ ] Analytics events firing
345
313
 
346
- Use the `cn` function for conditional classes:
314
+ **Done? 🎉 Successfully integrated!**
347
315
 
348
- ```tsx
349
- import { cn } from '@ai-ad-network/frontend-sdk';
316
+ ---
350
317
 
351
- <div className={cn(
352
- 'base-class',
353
- isActive && 'active-class',
354
- 'more-classes'
355
- )} />
356
- ```
318
+ ## 🆘 Support
357
319
 
358
- ## TypeScript Support
320
+ - 📧 Email: support@ai-ad-network.com
321
+ - 📖 Docs: https://docs.ai-ad-network.com
322
+ - 🐛 Issues: https://github.com/ai-ad-network/frontend-sdk/issues
359
323
 
360
- Full TypeScript support with exported types:
324
+ ---
361
325
 
362
- ```tsx
363
- import type {
364
- KoahAd,
365
- IntentResult,
366
- AdFormat,
367
- AdSource,
368
- RoutingInfo,
369
- } from '@ai-ad-network/frontend-sdk';
326
+ ## 📦 Package Exports
327
+
328
+ ```json
329
+ {
330
+ "exports": {
331
+ ".": {
332
+ "import": "./dist/index.esm.js",
333
+ "require": "./dist/index.js",
334
+ "types": "./dist/index.d.ts"
335
+ },
336
+ "./universal": {
337
+ "import": "./dist/universal/universal.esm.js",
338
+ "require": "./dist/universal/universal.cjs.js",
339
+ "types": "./dist/universal/universal.d.ts"
340
+ }
341
+ }
342
+ }
370
343
  ```
371
344
 
372
- ## Integration Guide
373
-
374
- For detailed Chatbox integration instructions, see [CHATBOX_INTEGRATION.md](./CHATBOX_INTEGRATION.md).
375
-
376
- ## Development
377
-
378
- ```bash
379
- # Install dependencies
380
- npm install
381
-
382
- # Run Storybook
383
- npm run storybook
345
+ ---
384
346
 
385
- # Build library
386
- npm run build
347
+ ## 📄 License
387
348
 
388
- # Run demo app
389
- cd demo-app && npm run dev
390
- ```
349
+ MIT
391
350
 
392
- ## License
351
+ ---
393
352
 
394
- MIT
353
+ **SDK Version**: 1.0.7
354
+ **Last Updated**: 2026-01-26