@adtogether/web-sdk 0.1.13 → 0.1.20

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/CHANGELOG.md CHANGED
@@ -1,34 +1,37 @@
1
- ## 0.1.13
2
-
3
- * **Sync**: Version parity across all AdTogether SDKs.
4
-
5
- ## 0.1.12
6
-
7
- * **Feature**: Added `showCloseButton` to React components.
8
- * **Standardization**: Support for `onAdLoaded` and `onAdFailedToLoad` across all platforms.
9
- * **Layout**: Enhanced responsiveness and safety checks for ad rendering.
10
-
11
- ## 0.1.9
12
-
13
- * **Feature**: Added `onAdLoaded` and `onAdFailedToLoad` callback support to React components.
14
- * **Responsive**: Improved responsiveness for both Banner and Interstitial ad components.
15
- * **Standardization**: Updated API signatures to match the unified AdTogether SDK standard.
16
-
17
- ## 0.1.7
18
-
19
- * Documentation improvements.
20
- * Localize ad assets for better registry rendering.
21
- * Update Discord invite link to https://discord.gg/maA8g4ADpk.
22
-
23
- ## 0.1.4
24
-
25
- * Update package metadata and dependencies.
26
-
27
- ## 0.1.1
28
-
29
- * Update repository URLs to new organization.
30
- * Prepare for version 0.1.1 release.
31
-
32
- ## 0.1.0
33
-
34
- * Initial release of the AdTogether Web SDK.
1
+ ## 0.1.14
2
+
3
+ * **Feature**: Added `onAdClosed` callback support to banner components.
4
+ * **Feature**: Improved automatic `bundleId` detection across all platforms.
5
+ * **Security**: Hardened ad-serving logic to prevent payout fraud.
6
+ * **Sync**: Version parity across all AdTogether SDKs.
7
+
8
+ ## 0.1.12
9
+
10
+ * **Feature**: Added `showCloseButton` to React components.
11
+ * **Standardization**: Support for `onAdLoaded` and `onAdFailedToLoad` across all platforms.
12
+ * **Layout**: Enhanced responsiveness and safety checks for ad rendering.
13
+
14
+ ## 0.1.9
15
+
16
+ * **Feature**: Added `onAdLoaded` and `onAdFailedToLoad` callback support to React components.
17
+ * **Responsive**: Improved responsiveness for both Banner and Interstitial ad components.
18
+ * **Standardization**: Updated API signatures to match the unified AdTogether SDK standard.
19
+
20
+ ## 0.1.7
21
+
22
+ * Documentation improvements.
23
+ * Localize ad assets for better registry rendering.
24
+ * Update Discord invite link to https://discord.gg/maA8g4ADpk.
25
+
26
+ ## 0.1.4
27
+
28
+ * Update package metadata and dependencies.
29
+
30
+ ## 0.1.1
31
+
32
+ * Update repository URLs to new organization.
33
+ * Prepare for version 0.1.1 release.
34
+
35
+ ## 0.1.0
36
+
37
+ * Initial release of the AdTogether Web SDK.
package/README.md CHANGED
@@ -1,147 +1,154 @@
1
- # AdTogether Web SDK
2
-
3
- [![npm version](https://img.shields.io/npm/v/@adtogether/web-sdk)](https://www.npmjs.com/package/@adtogether/web-sdk)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
-
6
- <p align="center">
7
- <strong>"Show an ad, get an ad shown"</strong><br>
8
- The Universal Ad Exchange & Reciprocal Marketing Platform
9
- </p>
10
-
11
- ---
12
-
13
- **AdTogether** is an ad exchange platform designed to empower developers and creators. By participating in our network, you can engage in reciprocal marketing for your own applications while simultaneously driving traffic to your products and helping you **increase conversions**. Our core philosophy is simple: **"Show an ad, get an ad shown"**.
14
-
15
- This SDK allows web developers (React and Vanilla JS) to easily integrate AdTogether ads into their applications. By displaying ads from other community members, you earn **Ad Credits** that allow your own app's ads to be shown across the AdTogether network.
16
-
17
- ### 🖼️ Visualizing the Experience
18
-
19
- | **Native Banner Ad** | **Interstitial Full-Screen** |
20
- |:---:|:---:|
21
- | ![Banner Example](doc/preview_standard.png) | ![Interstitial Example](doc/preview_premium.png) |
22
- | *Adaptive React Banner Component* | *Full-Screen Interstitial Experience* |
23
-
24
- ## Features
25
-
26
- - 🖼️ **Banner Ads** — Native React `AdTogetherBanner` component with automatic impression tracking and dark mode support.
27
- - 📺 **Interstitial Ads** — Full-screen `AdTogetherInterstitial` component with a configurable close-button countdown.
28
- - 🌑 **Dark Mode Support** — All ad components automatically adapt to system preference, or can be set to `'dark'` / `'light'` explicitly.
29
- - ⚖️ **Fair Exchange** — Automated impression and click tracking ensures fair distribution of ad credits.
30
- - 🔌 **Easy Integration** — A single `initialize()` call and one component is all you need to start earning credits and increase conversions.
31
- - 🧩 **Vanilla JS Support** — Core logic decoupled for use without React or any framework.
32
-
33
- ## Getting Started
34
-
35
- ### 1. Install
36
-
37
- ```bash
38
- npm install @adtogether/web-sdk
39
- ```
40
-
41
- ### 2. Initialize
42
-
43
- Call `AdTogether.initialize()` before rendering any ad components. You can obtain your App ID from the [AdTogether Dashboard](https://adtogether.relaxsoftwareapps.com/dashboard).
44
-
45
- ```typescript
46
- import { AdTogether } from '@adtogether/web-sdk';
47
-
48
- AdTogether.initialize({ appId: 'YOUR_APP_ID' });
49
- ```
50
-
51
- ## Usage
52
-
53
- ### Banner Ads
54
-
55
- Use the `AdTogetherBanner` component anywhere in your React tree. It fetches an ad, renders it, and automatically tracks impressions when 50% or more of the component is visible.
56
-
57
- ```jsx
58
- import { AdTogetherBanner } from '@adtogether/web-sdk/react';
59
-
60
- function MyApp() {
61
- return (
62
- <div>
63
- <h1>My Awesome Web App</h1>
64
-
65
- <AdTogetherBanner
66
- adUnitId="home_bottom_banner"
67
- onAdLoaded={() => console.log('Banner loaded!')}
68
- onAdFailedToLoad={(error) => console.error('Banner error:', error)}
69
- />
70
- </div>
71
- );
72
- }
73
- ```
74
-
75
- #### `AdTogetherBanner` Props
76
-
77
- | Prop | Type | Default | Description |
78
- |--------------------|-------------------------|-----------|-------------|
79
- | `adUnitId` | `string` | **required** | Unique identifier for this ad placement. |
80
- | `width` | `number \| string` | `'100%'` | Width of the ad element. |
81
- | `height` | `number \| string` | `'auto'` | Height of the ad element. |
82
- | `theme` | `'dark' \| 'light' \| 'auto'` | `'auto'` | Color scheme. `'auto'` follows system preference. |
83
- | `onAdLoaded` | `() => void` | — | Called when the ad has been successfully fetched and rendered. |
84
- | `onAdFailedToLoad` | `(error: Error) => void`| — | Called if the ad fails to load. |
85
- | `className` | `string` | `''` | Additional CSS class name for the container. |
86
- | `style` | `React.CSSProperties` | `{}` | Additional inline styles for the container. |
87
-
88
- ### Interstitial Ads
89
-
90
- Show a full-screen interstitial ad as a portal overlay. A countdown timer is displayed before the user is allowed to close the ad.
91
-
92
- ```jsx
93
- import { useState } from 'react';
94
- import { AdTogetherInterstitial } from '@adtogether/web-sdk/react';
95
-
96
- function MyApp() {
97
- const [showInterstitial, setShowInterstitial] = useState(false);
98
-
99
- return (
100
- <div>
101
- <button onClick={() => setShowInterstitial(true)}>
102
- Show Interstitial Ad
103
- </button>
104
-
105
- <AdTogetherInterstitial
106
- adUnitId="level_complete_interstitial"
107
- isOpen={showInterstitial}
108
- onClose={() => setShowInterstitial(false)}
109
- closeDelay={5}
110
- onAdLoaded={() => console.log('Interstitial ready')}
111
- onAdFailedToLoad={(error) => console.error('Interstitial error:', error)}
112
- />
113
- </div>
114
- );
115
- }
116
- ```
117
-
118
- #### `AdTogetherInterstitial` Props
119
-
120
- | Prop | Type | Default | Description |
121
- |--------------------|-------------------------|-----------|-------------|
122
- | `adUnitId` | `string` | **required** | Unique identifier for this ad placement. |
123
- | `isOpen` | `boolean` | **required** | When `true`, the interstitial is displayed. |
124
- | `onClose` | `() => void` | **required** | Called when the user closes the interstitial. |
125
- | `closeDelay` | `number` | `3` | Seconds before the close button appears. A countdown is shown during this time. |
126
- | `theme` | `'dark' \| 'light' \| 'auto'` | `'auto'` | Color scheme. `'auto'` follows system preference. |
127
- | `onAdLoaded` | `() => void` | — | Called when the ad has been successfully fetched. |
128
- | `onAdFailedToLoad` | `(error: Error) => void`| — | Called if the ad fails to load. The dialog is automatically dismissed on failure. |
129
-
130
- ## How Credits Work
131
-
132
- 1. **Earn credits** — Every time your app displays an ad from the AdTogether network and the impression is verified, you earn ad credits.
133
- 2. **Spend credits** — Your ad credits are automatically spent to show *your* campaigns inside other apps on the network, helping you increase conversions.
134
- 3. **Fair weighting** — Different ad formats and geographies have different credit weights, ensuring a level playing field for apps of all sizes.
135
-
136
- Create and manage your campaigns from the [AdTogether Dashboard](https://adtogether.relaxsoftwareapps.com/dashboard).
137
-
138
- ## Additional Information
139
-
140
- - 📖 **Documentation**: [adtogether.relaxsoftwareapps.com/docs](https://adtogether.relaxsoftwareapps.com/docs)
141
- - 🐛 **Issues**: [GitHub Issues](https://github.com/undecided2003/AdTogether/issues)
142
- - 💬 **Support**: Join our [Discord community](https://discord.gg/maA8g4ADpk) for real-time help.
143
- - 🌐 **Dashboard**: [adtogether.relaxsoftwareapps.com/dashboard](https://adtogether.relaxsoftwareapps.com/dashboard)
144
-
145
- ## License
146
-
147
- This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
1
+ # AdTogether Web SDK
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@adtogether/web-sdk)](https://www.npmjs.com/package/@adtogether/web-sdk)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ <p align="center">
7
+ <strong>"Show an ad, get an ad shown"</strong><br>
8
+ The Universal Ad Exchange & Reciprocal Marketing Platform
9
+ </p>
10
+
11
+ ---
12
+
13
+ **AdTogether** is an ad exchange platform designed to empower developers and creators. By participating in our network, you can engage in reciprocal marketing for your own applications while simultaneously driving traffic to your products and helping you **increase conversions**. Our core philosophy is simple: **"Show an ad, get an ad shown"**.
14
+
15
+ This SDK allows web developers (React and Vanilla JS) to easily integrate AdTogether ads into their applications. By displaying ads from other community members, you earn **Ad Credits** that allow your own app's ads to be shown across the AdTogether network.
16
+
17
+ ### 🖼️ Visualizing the Experience
18
+
19
+ | **Native Banner Ad** | **Interstitial Full-Screen** |
20
+ |:---:|:---:|
21
+ | ![Banner Example](doc/preview_standard.png) | ![Interstitial Example](doc/preview_premium.png) |
22
+ | *Adaptive React Banner Component* | *Full-Screen Interstitial Experience* |
23
+
24
+ ## Features
25
+
26
+ - 🖼️ **Banner Ads** — Native React `AdTogetherBanner` component with automatic impression tracking and dark mode support.
27
+ - 📺 **Interstitial Ads** — Full-screen `AdTogetherInterstitial` component with a configurable close-button countdown.
28
+ - 🌑 **Dark Mode Support** — All ad components automatically adapt to system preference, or can be set to `'dark'` / `'light'` explicitly.
29
+ - ⚖️ **Fair Exchange** — Automated impression and click tracking ensures fair distribution of ad credits.
30
+ - 🔌 **Easy Integration** — A single `initialize()` call and one component is all you need to start earning credits and increase conversions.
31
+ - 🧩 **Vanilla JS Support** — Core logic decoupled for use without React or any framework.
32
+
33
+ ## Getting Started
34
+
35
+ ### 1. Install
36
+
37
+ ```bash
38
+ npm install @adtogether/web-sdk
39
+ ```
40
+
41
+ ### 2. Initialize
42
+
43
+ Call `AdTogether.initialize()` before rendering any ad components. You can obtain your App ID from the [AdTogether Dashboard](https://adtogether.relaxsoftwareapps.com/dashboard).
44
+
45
+ ```typescript
46
+ import { AdTogether } from '@adtogether/web-sdk';
47
+
48
+ AdTogether.initialize({
49
+ appId: 'YOUR_APP_ID',
50
+ // bundleId: 'com.example.app' // optional: automatically detected from window.location.hostname
51
+ });
52
+ ```
53
+
54
+ ## Usage
55
+
56
+ ### Banner Ads
57
+
58
+ Use the `AdTogetherBanner` component anywhere in your React tree. It fetches an ad, renders it, and automatically tracks impressions when 50% or more of the component is visible.
59
+
60
+ ```jsx
61
+ import { AdTogetherBanner } from '@adtogether/web-sdk/react';
62
+
63
+ function MyApp() {
64
+ return (
65
+ <div>
66
+ <h1>My Awesome Web App</h1>
67
+
68
+ <AdTogetherBanner
69
+ adUnitId="home_bottom_banner"
70
+ showCloseButton={true}
71
+ onAdLoaded={() => console.log('Banner loaded!')}
72
+ onAdFailedToLoad={(error) => console.error('Banner error:', error)}
73
+ onAdClosed={() => console.log('Banner closed!')}
74
+ />
75
+ </div>
76
+ );
77
+ }
78
+ ```
79
+
80
+ #### `AdTogetherBanner` Props
81
+
82
+ | Prop | Type | Default | Description |
83
+ |--------------------|-------------------------|-----------|-------------|
84
+ | `adUnitId` | `string` | **required** | Unique identifier for this ad placement. |
85
+ | `showCloseButton` | `boolean` | `false` | Show a dismissable close button overlay. |
86
+ | `onAdClosed` | `() => void` | — | Called when the user closes the ad. |
87
+ | `width` | `number \| string` | `'100%'` | Width of the ad element. |
88
+ | `height` | `number \| string` | `'auto'` | Height of the ad element. |
89
+ | `theme` | `'dark' \| 'light' \| 'auto'` | `'auto'` | Color scheme. `'auto'` follows system preference. |
90
+ | `onAdLoaded` | `() => void` | — | Called when the ad has been successfully fetched and rendered. |
91
+ | `onAdFailedToLoad` | `(error: Error) => void`| — | Called if the ad fails to load. |
92
+ | `className` | `string` | `''` | Additional CSS class name for the container. |
93
+ | `style` | `React.CSSProperties` | `{}` | Additional inline styles for the container. |
94
+
95
+ ### Interstitial Ads
96
+
97
+ Show a full-screen interstitial ad as a portal overlay. A countdown timer is displayed before the user is allowed to close the ad.
98
+
99
+ ```jsx
100
+ import { useState } from 'react';
101
+ import { AdTogetherInterstitial } from '@adtogether/web-sdk/react';
102
+
103
+ function MyApp() {
104
+ const [showInterstitial, setShowInterstitial] = useState(false);
105
+
106
+ return (
107
+ <div>
108
+ <button onClick={() => setShowInterstitial(true)}>
109
+ Show Interstitial Ad
110
+ </button>
111
+
112
+ <AdTogetherInterstitial
113
+ adUnitId="level_complete_interstitial"
114
+ isOpen={showInterstitial}
115
+ onClose={() => setShowInterstitial(false)}
116
+ closeDelay={5}
117
+ onAdLoaded={() => console.log('Interstitial ready')}
118
+ onAdFailedToLoad={(error) => console.error('Interstitial error:', error)}
119
+ />
120
+ </div>
121
+ );
122
+ }
123
+ ```
124
+
125
+ #### `AdTogetherInterstitial` Props
126
+
127
+ | Prop | Type | Default | Description |
128
+ |--------------------|-------------------------|-----------|-------------|
129
+ | `adUnitId` | `string` | **required** | Unique identifier for this ad placement. |
130
+ | `isOpen` | `boolean` | **required** | When `true`, the interstitial is displayed. |
131
+ | `onClose` | `() => void` | **required** | Called when the user closes the interstitial. |
132
+ | `closeDelay` | `number` | `3` | Seconds before the close button appears. A countdown is shown during this time. |
133
+ | `theme` | `'dark' \| 'light' \| 'auto'` | `'auto'` | Color scheme. `'auto'` follows system preference. |
134
+ | `onAdLoaded` | `() => void` | — | Called when the ad has been successfully fetched. |
135
+ | `onAdFailedToLoad` | `(error: Error) => void`| — | Called if the ad fails to load. The dialog is automatically dismissed on failure. |
136
+
137
+ ## How Credits Work
138
+
139
+ 1. **Earn credits** — Every time your app displays an ad from the AdTogether network and the impression is verified, you earn ad credits.
140
+ 2. **Spend credits** — Your ad credits are automatically spent to show *your* campaigns inside other apps on the network, helping you increase conversions.
141
+ 3. **Fair weighting** — Different ad formats and geographies have different credit weights, ensuring a level playing field for apps of all sizes.
142
+
143
+ Create and manage your campaigns from the [AdTogether Dashboard](https://adtogether.relaxsoftwareapps.com/dashboard).
144
+
145
+ ## Additional Information
146
+
147
+ - 📖 **Documentation**: [adtogether.relaxsoftwareapps.com/docs](https://adtogether.relaxsoftwareapps.com/docs)
148
+ - 🐛 **Issues**: [GitHub Issues](https://github.com/undecided2003/AdTogether/issues)
149
+ - 💬 **Support**: Join our [Discord community](https://discord.gg/maA8g4ADpk) for real-time help.
150
+ - 🌐 **Dashboard**: [adtogether.relaxsoftwareapps.com/dashboard](https://adtogether.relaxsoftwareapps.com/dashboard)
151
+
152
+ ## License
153
+
154
+ This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
@@ -13,6 +13,11 @@ var AdTogether = class _AdTogether {
13
13
  static initialize(options) {
14
14
  const sdk = _AdTogether.shared;
15
15
  sdk.appId = options.apiKey || options.appId;
16
+ if (options.bundleId) {
17
+ sdk.bundleId = options.bundleId;
18
+ } else if (typeof window !== "undefined") {
19
+ sdk.bundleId = window.location.hostname;
20
+ }
16
21
  if (options.allowSelfAds !== void 0) {
17
22
  sdk.allowSelfAds = options.allowSelfAds;
18
23
  }
@@ -43,6 +48,9 @@ var AdTogether = class _AdTogether {
43
48
  if (sdk.lastAdId) {
44
49
  url += `&exclude=${sdk.lastAdId}`;
45
50
  }
51
+ if (sdk.bundleId) {
52
+ url += `&bundleId=${sdk.bundleId}`;
53
+ }
46
54
  url += `&allowSelfAds=${sdk.allowSelfAds}`;
47
55
  if (typeof window !== "undefined") {
48
56
  url += `&sourceUrl=${encodeURIComponent(window.location.href)}`;
@@ -74,7 +82,11 @@ var AdTogether = class _AdTogether {
74
82
  body: JSON.stringify({
75
83
  adId,
76
84
  token,
77
- apiKey: _AdTogether.shared.appId
85
+ apiKey: _AdTogether.shared.appId,
86
+ ..._AdTogether.shared.bundleId ? { bundleId: _AdTogether.shared.bundleId } : {},
87
+ // Send platform and environment to match Flutter SDK
88
+ platform: "web",
89
+ environment: typeof process !== "undefined" && process.env?.NODE_ENV === "development" ? "development" : "production"
78
90
  })
79
91
  }).catch(console.error);
80
92
  }
package/dist/index.d.mts CHANGED
@@ -12,6 +12,7 @@ interface AdTogetherOptions {
12
12
  appId?: string;
13
13
  apiKey?: string;
14
14
  baseUrl?: string;
15
+ bundleId?: string;
15
16
  /** Whether to show your own ads as fallback if no external ads are available. Defaults to true. */
16
17
  allowSelfAds?: boolean;
17
18
  }
@@ -19,6 +20,7 @@ interface AdTogetherOptions {
19
20
  declare class AdTogether {
20
21
  private static instance;
21
22
  private appId?;
23
+ private bundleId?;
22
24
  private allowSelfAds;
23
25
  baseUrl: string;
24
26
  private constructor();
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ interface AdTogetherOptions {
12
12
  appId?: string;
13
13
  apiKey?: string;
14
14
  baseUrl?: string;
15
+ bundleId?: string;
15
16
  /** Whether to show your own ads as fallback if no external ads are available. Defaults to true. */
16
17
  allowSelfAds?: boolean;
17
18
  }
@@ -19,6 +20,7 @@ interface AdTogetherOptions {
19
20
  declare class AdTogether {
20
21
  private static instance;
21
22
  private appId?;
23
+ private bundleId?;
22
24
  private allowSelfAds;
23
25
  baseUrl: string;
24
26
  private constructor();
package/dist/index.js CHANGED
@@ -39,6 +39,11 @@ var AdTogether = class _AdTogether {
39
39
  static initialize(options) {
40
40
  const sdk = _AdTogether.shared;
41
41
  sdk.appId = options.apiKey || options.appId;
42
+ if (options.bundleId) {
43
+ sdk.bundleId = options.bundleId;
44
+ } else if (typeof window !== "undefined") {
45
+ sdk.bundleId = window.location.hostname;
46
+ }
42
47
  if (options.allowSelfAds !== void 0) {
43
48
  sdk.allowSelfAds = options.allowSelfAds;
44
49
  }
@@ -69,6 +74,9 @@ var AdTogether = class _AdTogether {
69
74
  if (sdk.lastAdId) {
70
75
  url += `&exclude=${sdk.lastAdId}`;
71
76
  }
77
+ if (sdk.bundleId) {
78
+ url += `&bundleId=${sdk.bundleId}`;
79
+ }
72
80
  url += `&allowSelfAds=${sdk.allowSelfAds}`;
73
81
  if (typeof window !== "undefined") {
74
82
  url += `&sourceUrl=${encodeURIComponent(window.location.href)}`;
@@ -100,7 +108,11 @@ var AdTogether = class _AdTogether {
100
108
  body: JSON.stringify({
101
109
  adId,
102
110
  token,
103
- apiKey: _AdTogether.shared.appId
111
+ apiKey: _AdTogether.shared.appId,
112
+ ..._AdTogether.shared.bundleId ? { bundleId: _AdTogether.shared.bundleId } : {},
113
+ // Send platform and environment to match Flutter SDK
114
+ platform: "web",
115
+ environment: typeof process !== "undefined" && process.env?.NODE_ENV === "development" ? "development" : "production"
104
116
  })
105
117
  }).catch(console.error);
106
118
  }
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AdTogether
3
- } from "./chunk-7IJIBJD4.mjs";
3
+ } from "./chunk-RW43ES42.mjs";
4
4
  export {
5
5
  AdTogether
6
6
  };
@@ -6,6 +6,10 @@ interface AdTogetherBannerProps {
6
6
  style?: React.CSSProperties;
7
7
  onAdLoaded?: () => void;
8
8
  onAdFailedToLoad?: (error: Error) => void;
9
+ /** Whether to show a close button on the banner */
10
+ showCloseButton?: boolean;
11
+ /** Callback when the user closes the ad */
12
+ onAdClosed?: () => void;
9
13
  /** Width of the ad element. Defaults to '100%' */
10
14
  width?: number | string;
11
15
  /** Height of the ad element. Defaults to 'auto' */
@@ -6,6 +6,10 @@ interface AdTogetherBannerProps {
6
6
  style?: React.CSSProperties;
7
7
  onAdLoaded?: () => void;
8
8
  onAdFailedToLoad?: (error: Error) => void;
9
+ /** Whether to show a close button on the banner */
10
+ showCloseButton?: boolean;
11
+ /** Callback when the user closes the ad */
12
+ onAdClosed?: () => void;
9
13
  /** Width of the ad element. Defaults to '100%' */
10
14
  width?: number | string;
11
15
  /** Height of the ad element. Defaults to 'auto' */