@adtogether/web-sdk 0.2.1 → 0.2.3
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 +58 -52
- package/README.md +165 -165
- package/errors.txt +2 -2
- package/package.json +58 -58
- package/src/react/AdTogetherInterstitial.tsx +370 -370
- package/tsconfig.json +19 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,52 +1,58 @@
|
|
|
1
|
-
## 0.2.
|
|
2
|
-
* **
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* **
|
|
20
|
-
* **
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* **Feature**:
|
|
26
|
-
* **
|
|
27
|
-
* **
|
|
28
|
-
|
|
29
|
-
## 0.1.
|
|
30
|
-
|
|
31
|
-
* **Feature**: Added `
|
|
32
|
-
* **
|
|
33
|
-
* **
|
|
34
|
-
|
|
35
|
-
## 0.1.
|
|
36
|
-
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
|
|
41
|
-
## 0.1.
|
|
42
|
-
|
|
43
|
-
*
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
## 0.2.3
|
|
2
|
+
* **Sync**: Version parity across all AdTogether SDKs.
|
|
3
|
+
|
|
4
|
+
## 0.2.2
|
|
5
|
+
* **Domain**: Updated base API domain to `www.ad-together.org`.
|
|
6
|
+
|
|
7
|
+
## 0.2.0
|
|
8
|
+
* **Security**: Implemented strict validation for required parameters and API keys.
|
|
9
|
+
* **Error Handling**: Improved error handling for invalid or missing App IDs across all platforms, ensuring graceful failures with descriptive logs.
|
|
10
|
+
|
|
11
|
+
## 0.1.25
|
|
12
|
+
* **Docs**: Standardized SDK documentation across all platforms.
|
|
13
|
+
|
|
14
|
+
## 0.1.23
|
|
15
|
+
|
|
16
|
+
* **Sync**: Version parity across all AdTogether SDKs.
|
|
17
|
+
|
|
18
|
+
## 0.1.22
|
|
19
|
+
* **Brand**: Added "Powered by AdTogether" attribution to all Interstitial ad formats.
|
|
20
|
+
* **Sync**: Unified versioning (0.1.20) across all AdTogether SDKs.
|
|
21
|
+
|
|
22
|
+
## 0.1.14
|
|
23
|
+
|
|
24
|
+
* **Feature**: Added `onAdClosed` callback support to banner components.
|
|
25
|
+
* **Feature**: Improved automatic `bundleId` detection across all platforms.
|
|
26
|
+
* **Security**: Hardened ad-serving logic to prevent payout fraud.
|
|
27
|
+
* **Sync**: Version parity across all AdTogether SDKs.
|
|
28
|
+
|
|
29
|
+
## 0.1.12
|
|
30
|
+
|
|
31
|
+
* **Feature**: Added `showCloseButton` to React components.
|
|
32
|
+
* **Standardization**: Support for `onAdLoaded` and `onAdFailedToLoad` across all platforms.
|
|
33
|
+
* **Layout**: Enhanced responsiveness and safety checks for ad rendering.
|
|
34
|
+
|
|
35
|
+
## 0.1.9
|
|
36
|
+
|
|
37
|
+
* **Feature**: Added `onAdLoaded` and `onAdFailedToLoad` callback support to React components.
|
|
38
|
+
* **Responsive**: Improved responsiveness for both Banner and Interstitial ad components.
|
|
39
|
+
* **Standardization**: Updated API signatures to match the unified AdTogether SDK standard.
|
|
40
|
+
|
|
41
|
+
## 0.1.7
|
|
42
|
+
|
|
43
|
+
* Documentation improvements.
|
|
44
|
+
* Localize ad assets for better registry rendering.
|
|
45
|
+
* Update Discord invite link to https://discord.gg/maA8g4ADpk.
|
|
46
|
+
|
|
47
|
+
## 0.1.4
|
|
48
|
+
|
|
49
|
+
* Update package metadata and dependencies.
|
|
50
|
+
|
|
51
|
+
## 0.1.1
|
|
52
|
+
|
|
53
|
+
* Update repository URLs to new organization.
|
|
54
|
+
* Prepare for version 0.1.1 release.
|
|
55
|
+
|
|
56
|
+
## 0.1.0
|
|
57
|
+
|
|
58
|
+
* Initial release of the AdTogether Web SDK.
|
package/README.md
CHANGED
|
@@ -1,165 +1,165 @@
|
|
|
1
|
-
# AdTogether Web SDK
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
[](https://www.npmjs.com/package/@adtogether/web-sdk)
|
|
7
|
-
[](https://opensource.org/licenses/MIT)
|
|
8
|
-
|
|
9
|
-
<p align="center">
|
|
10
|
-
<strong>"Show an ad, get an ad shown"</strong><br>
|
|
11
|
-
The Universal Ad Exchange & Reciprocal Marketing Platform
|
|
12
|
-
</p>
|
|
13
|
-
|
|
14
|
-
> [!IMPORTANT]
|
|
15
|
-
> **Developer Account Required**: Before integrating the SDK, you must create a developer account at [https://www.ad-together.org](https://www.ad-together.org) to generate your `appId` and configure your ad units. Integration will not work without a valid `appId`.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
**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"**.
|
|
21
|
-
|
|
22
|
-
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.
|
|
23
|
-
|
|
24
|
-
<p align="center">
|
|
25
|
-
<img src="https://www.ad-together.org/dashboard.png" width="800" alt="Developer Dashboard">
|
|
26
|
-
</p>
|
|
27
|
-
|
|
28
|
-
### 🖼️ Visualizing the Experience
|
|
29
|
-
|
|
30
|
-
| **Native Banner Ad** | **Interstitial Full-Screen** |
|
|
31
|
-
|:---:|:---:|
|
|
32
|
-
|  |  |
|
|
33
|
-
| *Adaptive React Banner Component* | *Full-Screen Interstitial Experience* |
|
|
34
|
-
|
|
35
|
-
## Features
|
|
36
|
-
|
|
37
|
-
- 🖼️ **Banner Ads** — Native React `AdTogetherBanner` component with automatic impression tracking and dark mode support.
|
|
38
|
-
- 📺 **Interstitial Ads** — Full-screen `AdTogetherInterstitial` component with a configurable close-button countdown.
|
|
39
|
-
- 🌑 **Dark Mode Support** — All ad components automatically adapt to system preference, or can be set to `'dark'` / `'light'` explicitly.
|
|
40
|
-
- ⚖️ **Fair Exchange** — Automated impression and click tracking ensures fair distribution of ad credits.
|
|
41
|
-
- 🔌 **Easy Integration** — A single `initialize()` call and one component is all you need to start earning credits and increase conversions.
|
|
42
|
-
- 🧩 **Vanilla JS Support** — Core logic decoupled for use without React or any framework.
|
|
43
|
-
|
|
44
|
-
## Getting Started
|
|
45
|
-
|
|
46
|
-
### 1. Install
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
npm install @adtogether/web-sdk
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### 2. Initialize
|
|
53
|
-
|
|
54
|
-
Call `AdTogether.initialize()` before rendering any ad components. You can obtain your App ID from the [AdTogether Dashboard](https://www.ad-together.org/dashboard).
|
|
55
|
-
|
|
56
|
-
```typescript
|
|
57
|
-
import { AdTogether } from '@adtogether/web-sdk';
|
|
58
|
-
|
|
59
|
-
AdTogether.initialize({
|
|
60
|
-
appId: 'YOUR_APP_ID',
|
|
61
|
-
// bundleId: 'com.example.app' // optional: automatically detected from window.location.hostname
|
|
62
|
-
});
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Usage
|
|
66
|
-
|
|
67
|
-
### Banner Ads
|
|
68
|
-
|
|
69
|
-
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.
|
|
70
|
-
|
|
71
|
-
```jsx
|
|
72
|
-
import { AdTogetherBanner } from '@adtogether/web-sdk/react';
|
|
73
|
-
|
|
74
|
-
function MyApp() {
|
|
75
|
-
return (
|
|
76
|
-
<div>
|
|
77
|
-
<h1>My Awesome Web App</h1>
|
|
78
|
-
|
|
79
|
-
<AdTogetherBanner
|
|
80
|
-
adUnitId="home_bottom_banner"
|
|
81
|
-
showCloseButton={true}
|
|
82
|
-
onAdLoaded={() => console.log('Banner loaded!')}
|
|
83
|
-
onAdFailedToLoad={(error) => console.error('Banner error:', error)}
|
|
84
|
-
onAdClosed={() => console.log('Banner closed!')}
|
|
85
|
-
/>
|
|
86
|
-
</div>
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
#### `AdTogetherBanner` Props
|
|
92
|
-
|
|
93
|
-
| Prop | Type | Default | Description |
|
|
94
|
-
|--------------------|-------------------------|-----------|-------------|
|
|
95
|
-
| `adUnitId` | `string` | `'default'` | Optional label for this ad placement (e.g. `'home_banner'`, `'sidebar'`). Used for analytics grouping only — not validated server-side. |
|
|
96
|
-
| `showCloseButton` | `boolean` | `false` | Show a dismissable close button overlay. |
|
|
97
|
-
| `onAdClosed` | `() => void` | — | Called when the user closes the ad. |
|
|
98
|
-
| `width` | `number \| string` | `'100%'` | Width of the ad element. |
|
|
99
|
-
| `height` | `number \| string` | `'auto'` | Height of the ad element. |
|
|
100
|
-
| `theme` | `'dark' \| 'light' \| 'auto'` | `'auto'` | Color scheme. `'auto'` follows system preference. |
|
|
101
|
-
| `onAdLoaded` | `() => void` | — | Called when the ad has been successfully fetched and rendered. |
|
|
102
|
-
| `onAdFailedToLoad` | `(error: Error) => void`| — | Called if the ad fails to load. |
|
|
103
|
-
| `className` | `string` | `''` | Additional CSS class name for the container. |
|
|
104
|
-
| `style` | `React.CSSProperties` | `{}` | Additional inline styles for the container. |
|
|
105
|
-
|
|
106
|
-
### Interstitial Ads
|
|
107
|
-
|
|
108
|
-
Show a full-screen interstitial ad as a portal overlay. A countdown timer is displayed before the user is allowed to close the ad.
|
|
109
|
-
|
|
110
|
-
```jsx
|
|
111
|
-
import { useState } from 'react';
|
|
112
|
-
import { AdTogetherInterstitial } from '@adtogether/web-sdk/react';
|
|
113
|
-
|
|
114
|
-
function MyApp() {
|
|
115
|
-
const [showInterstitial, setShowInterstitial] = useState(false);
|
|
116
|
-
|
|
117
|
-
return (
|
|
118
|
-
<div>
|
|
119
|
-
<button onClick={() => setShowInterstitial(true)}>
|
|
120
|
-
Show Interstitial Ad
|
|
121
|
-
</button>
|
|
122
|
-
|
|
123
|
-
<AdTogetherInterstitial
|
|
124
|
-
adUnitId="level_complete_interstitial"
|
|
125
|
-
isOpen={showInterstitial}
|
|
126
|
-
onClose={() => setShowInterstitial(false)}
|
|
127
|
-
closeDelay={5}
|
|
128
|
-
onAdLoaded={() => console.log('Interstitial ready')}
|
|
129
|
-
onAdFailedToLoad={(error) => console.error('Interstitial error:', error)}
|
|
130
|
-
/>
|
|
131
|
-
</div>
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
#### `AdTogetherInterstitial` Props
|
|
137
|
-
|
|
138
|
-
| Prop | Type | Default | Description |
|
|
139
|
-
|--------------------|-------------------------|-----------|-------------|
|
|
140
|
-
| `adUnitId` | `string` | `'default'` | Optional label for this ad placement. Used for analytics grouping only. |
|
|
141
|
-
| `isOpen` | `boolean` | **required** | When `true`, the interstitial is displayed. |
|
|
142
|
-
| `onClose` | `() => void` | **required** | Called when the user closes the interstitial. |
|
|
143
|
-
| `closeDelay` | `number` | `3` | Seconds before the close button appears. A countdown is shown during this time. |
|
|
144
|
-
| `theme` | `'dark' \| 'light' \| 'auto'` | `'auto'` | Color scheme. `'auto'` follows system preference. |
|
|
145
|
-
| `onAdLoaded` | `() => void` | — | Called when the ad has been successfully fetched. |
|
|
146
|
-
| `onAdFailedToLoad` | `(error: Error) => void`| — | Called if the ad fails to load. The dialog is automatically dismissed on failure. |
|
|
147
|
-
|
|
148
|
-
## How Credits Work
|
|
149
|
-
|
|
150
|
-
1. **Earn credits** — Every time your app displays an ad from the AdTogether network and the impression is verified, you earn ad credits.
|
|
151
|
-
2. **Spend credits** — Your ad credits are automatically spent to show *your* campaigns inside other apps on the network, helping you increase conversions.
|
|
152
|
-
3. **Fair weighting** — Different ad formats and geographies have different credit weights, ensuring a level playing field for apps of all sizes.
|
|
153
|
-
|
|
154
|
-
Create and manage your campaigns from the [AdTogether Dashboard](https://www.ad-together.org/dashboard).
|
|
155
|
-
|
|
156
|
-
## Additional Information
|
|
157
|
-
|
|
158
|
-
- 📖 **Documentation**: [www.ad-together.org/docs](https://www.ad-together.org/docs)
|
|
159
|
-
- 🐛 **Issues**: [GitHub Issues](https://github.com/undecided2003/AdTogether/issues)
|
|
160
|
-
- 💬 **Support**: Join our [Discord community](https://discord.gg/maA8g4ADpk) for real-time help.
|
|
161
|
-
- 🌐 **Dashboard**: [www.ad-together.org/dashboard](https://www.ad-together.org/dashboard)
|
|
162
|
-
|
|
163
|
-
## License
|
|
164
|
-
|
|
165
|
-
This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
|
|
1
|
+
# AdTogether Web SDK
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/@adtogether/web-sdk)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<strong>"Show an ad, get an ad shown"</strong><br>
|
|
11
|
+
The Universal Ad Exchange & Reciprocal Marketing Platform
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
> [!IMPORTANT]
|
|
15
|
+
> **Developer Account Required**: Before integrating the SDK, you must create a developer account at [https://www.ad-together.org](https://www.ad-together.org) to generate your `appId` and configure your ad units. Integration will not work without a valid `appId`.
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
**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"**.
|
|
21
|
+
|
|
22
|
+
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.
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<img src="https://www.ad-together.org/dashboard.png" width="800" alt="Developer Dashboard">
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
### 🖼️ Visualizing the Experience
|
|
29
|
+
|
|
30
|
+
| **Native Banner Ad** | **Interstitial Full-Screen** |
|
|
31
|
+
|:---:|:---:|
|
|
32
|
+
|  |  |
|
|
33
|
+
| *Adaptive React Banner Component* | *Full-Screen Interstitial Experience* |
|
|
34
|
+
|
|
35
|
+
## Features
|
|
36
|
+
|
|
37
|
+
- 🖼️ **Banner Ads** — Native React `AdTogetherBanner` component with automatic impression tracking and dark mode support.
|
|
38
|
+
- 📺 **Interstitial Ads** — Full-screen `AdTogetherInterstitial` component with a configurable close-button countdown.
|
|
39
|
+
- 🌑 **Dark Mode Support** — All ad components automatically adapt to system preference, or can be set to `'dark'` / `'light'` explicitly.
|
|
40
|
+
- ⚖️ **Fair Exchange** — Automated impression and click tracking ensures fair distribution of ad credits.
|
|
41
|
+
- 🔌 **Easy Integration** — A single `initialize()` call and one component is all you need to start earning credits and increase conversions.
|
|
42
|
+
- 🧩 **Vanilla JS Support** — Core logic decoupled for use without React or any framework.
|
|
43
|
+
|
|
44
|
+
## Getting Started
|
|
45
|
+
|
|
46
|
+
### 1. Install
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm install @adtogether/web-sdk
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 2. Initialize
|
|
53
|
+
|
|
54
|
+
Call `AdTogether.initialize()` before rendering any ad components. You can obtain your App ID from the [AdTogether Dashboard](https://www.ad-together.org/dashboard).
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
import { AdTogether } from '@adtogether/web-sdk';
|
|
58
|
+
|
|
59
|
+
AdTogether.initialize({
|
|
60
|
+
appId: 'YOUR_APP_ID',
|
|
61
|
+
// bundleId: 'com.example.app' // optional: automatically detected from window.location.hostname
|
|
62
|
+
});
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Usage
|
|
66
|
+
|
|
67
|
+
### Banner Ads
|
|
68
|
+
|
|
69
|
+
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.
|
|
70
|
+
|
|
71
|
+
```jsx
|
|
72
|
+
import { AdTogetherBanner } from '@adtogether/web-sdk/react';
|
|
73
|
+
|
|
74
|
+
function MyApp() {
|
|
75
|
+
return (
|
|
76
|
+
<div>
|
|
77
|
+
<h1>My Awesome Web App</h1>
|
|
78
|
+
|
|
79
|
+
<AdTogetherBanner
|
|
80
|
+
adUnitId="home_bottom_banner"
|
|
81
|
+
showCloseButton={true}
|
|
82
|
+
onAdLoaded={() => console.log('Banner loaded!')}
|
|
83
|
+
onAdFailedToLoad={(error) => console.error('Banner error:', error)}
|
|
84
|
+
onAdClosed={() => console.log('Banner closed!')}
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### `AdTogetherBanner` Props
|
|
92
|
+
|
|
93
|
+
| Prop | Type | Default | Description |
|
|
94
|
+
|--------------------|-------------------------|-----------|-------------|
|
|
95
|
+
| `adUnitId` | `string` | `'default'` | Optional label for this ad placement (e.g. `'home_banner'`, `'sidebar'`). Used for analytics grouping only — not validated server-side. |
|
|
96
|
+
| `showCloseButton` | `boolean` | `false` | Show a dismissable close button overlay. |
|
|
97
|
+
| `onAdClosed` | `() => void` | — | Called when the user closes the ad. |
|
|
98
|
+
| `width` | `number \| string` | `'100%'` | Width of the ad element. |
|
|
99
|
+
| `height` | `number \| string` | `'auto'` | Height of the ad element. |
|
|
100
|
+
| `theme` | `'dark' \| 'light' \| 'auto'` | `'auto'` | Color scheme. `'auto'` follows system preference. |
|
|
101
|
+
| `onAdLoaded` | `() => void` | — | Called when the ad has been successfully fetched and rendered. |
|
|
102
|
+
| `onAdFailedToLoad` | `(error: Error) => void`| — | Called if the ad fails to load. |
|
|
103
|
+
| `className` | `string` | `''` | Additional CSS class name for the container. |
|
|
104
|
+
| `style` | `React.CSSProperties` | `{}` | Additional inline styles for the container. |
|
|
105
|
+
|
|
106
|
+
### Interstitial Ads
|
|
107
|
+
|
|
108
|
+
Show a full-screen interstitial ad as a portal overlay. A countdown timer is displayed before the user is allowed to close the ad.
|
|
109
|
+
|
|
110
|
+
```jsx
|
|
111
|
+
import { useState } from 'react';
|
|
112
|
+
import { AdTogetherInterstitial } from '@adtogether/web-sdk/react';
|
|
113
|
+
|
|
114
|
+
function MyApp() {
|
|
115
|
+
const [showInterstitial, setShowInterstitial] = useState(false);
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<div>
|
|
119
|
+
<button onClick={() => setShowInterstitial(true)}>
|
|
120
|
+
Show Interstitial Ad
|
|
121
|
+
</button>
|
|
122
|
+
|
|
123
|
+
<AdTogetherInterstitial
|
|
124
|
+
adUnitId="level_complete_interstitial"
|
|
125
|
+
isOpen={showInterstitial}
|
|
126
|
+
onClose={() => setShowInterstitial(false)}
|
|
127
|
+
closeDelay={5}
|
|
128
|
+
onAdLoaded={() => console.log('Interstitial ready')}
|
|
129
|
+
onAdFailedToLoad={(error) => console.error('Interstitial error:', error)}
|
|
130
|
+
/>
|
|
131
|
+
</div>
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
#### `AdTogetherInterstitial` Props
|
|
137
|
+
|
|
138
|
+
| Prop | Type | Default | Description |
|
|
139
|
+
|--------------------|-------------------------|-----------|-------------|
|
|
140
|
+
| `adUnitId` | `string` | `'default'` | Optional label for this ad placement. Used for analytics grouping only. |
|
|
141
|
+
| `isOpen` | `boolean` | **required** | When `true`, the interstitial is displayed. |
|
|
142
|
+
| `onClose` | `() => void` | **required** | Called when the user closes the interstitial. |
|
|
143
|
+
| `closeDelay` | `number` | `3` | Seconds before the close button appears. A countdown is shown during this time. |
|
|
144
|
+
| `theme` | `'dark' \| 'light' \| 'auto'` | `'auto'` | Color scheme. `'auto'` follows system preference. |
|
|
145
|
+
| `onAdLoaded` | `() => void` | — | Called when the ad has been successfully fetched. |
|
|
146
|
+
| `onAdFailedToLoad` | `(error: Error) => void`| — | Called if the ad fails to load. The dialog is automatically dismissed on failure. |
|
|
147
|
+
|
|
148
|
+
## How Credits Work
|
|
149
|
+
|
|
150
|
+
1. **Earn credits** — Every time your app displays an ad from the AdTogether network and the impression is verified, you earn ad credits.
|
|
151
|
+
2. **Spend credits** — Your ad credits are automatically spent to show *your* campaigns inside other apps on the network, helping you increase conversions.
|
|
152
|
+
3. **Fair weighting** — Different ad formats and geographies have different credit weights, ensuring a level playing field for apps of all sizes.
|
|
153
|
+
|
|
154
|
+
Create and manage your campaigns from the [AdTogether Dashboard](https://www.ad-together.org/dashboard).
|
|
155
|
+
|
|
156
|
+
## Additional Information
|
|
157
|
+
|
|
158
|
+
- 📖 **Documentation**: [www.ad-together.org/docs](https://www.ad-together.org/docs)
|
|
159
|
+
- 🐛 **Issues**: [GitHub Issues](https://github.com/undecided2003/AdTogether/issues)
|
|
160
|
+
- 💬 **Support**: Join our [Discord community](https://discord.gg/maA8g4ADpk) for real-time help.
|
|
161
|
+
- 🌐 **Dashboard**: [www.ad-together.org/dashboard](https://www.ad-together.org/dashboard)
|
|
162
|
+
|
|
163
|
+
## License
|
|
164
|
+
|
|
165
|
+
This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
|
package/errors.txt
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
tsconfig.json(15,25): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
|
2
|
-
Visit https://aka.ms/ts6 for migration information.
|
|
1
|
+
tsconfig.json(15,25): error TS5107: Option 'moduleResolution=node10' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
|
|
2
|
+
Visit https://aka.ms/ts6 for migration information.
|
package/package.json
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@adtogether/web-sdk",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "The official AdTogether Web SDK — reciprocal ad exchange to increase conversions and grow your audience.",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/undecided2003/adtogether-web-sdk.git"
|
|
8
|
-
},
|
|
9
|
-
"homepage": "https://www.ad-together.org",
|
|
10
|
-
"bugs": {
|
|
11
|
-
"url": "https://github.com/undecided2003/adtogether-web-sdk/issues"
|
|
12
|
-
},
|
|
13
|
-
"keywords": [
|
|
14
|
-
"ads",
|
|
15
|
-
"ad-exchange",
|
|
16
|
-
"monetization",
|
|
17
|
-
"advertising",
|
|
18
|
-
"react",
|
|
19
|
-
"reciprocal",
|
|
20
|
-
"conversions"
|
|
21
|
-
],
|
|
22
|
-
"publishConfig": {
|
|
23
|
-
"access": "public"
|
|
24
|
-
},
|
|
25
|
-
"main": "./dist/index.js",
|
|
26
|
-
"module": "./dist/index.mjs",
|
|
27
|
-
"types": "./dist/index.d.ts",
|
|
28
|
-
"exports": {
|
|
29
|
-
".": {
|
|
30
|
-
"types": "./dist/index.d.ts",
|
|
31
|
-
"require": "./dist/index.js",
|
|
32
|
-
"import": "./dist/index.mjs"
|
|
33
|
-
},
|
|
34
|
-
"./react": {
|
|
35
|
-
"types": "./dist/react/index.d.ts",
|
|
36
|
-
"require": "./dist/react/index.js",
|
|
37
|
-
"import": "./dist/react/index.mjs"
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"scripts": {
|
|
41
|
-
"build": "tsup",
|
|
42
|
-
"dev": "tsup --watch"
|
|
43
|
-
},
|
|
44
|
-
"author": "AdTogether Team",
|
|
45
|
-
"license": "MIT",
|
|
46
|
-
"type": "commonjs",
|
|
47
|
-
"peerDependencies": {
|
|
48
|
-
"react": "^19.2.4",
|
|
49
|
-
"react-dom": "^19.2.4"
|
|
50
|
-
},
|
|
51
|
-
"devDependencies": {
|
|
52
|
-
"@types/node": "^22.0.0",
|
|
53
|
-
"@types/react": "^19.2.14",
|
|
54
|
-
"@types/react-dom": "^19.2.3",
|
|
55
|
-
"tsup": "^8.5.1",
|
|
56
|
-
"typescript": "^5.3.3"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@adtogether/web-sdk",
|
|
3
|
+
"version": "0.2.3",
|
|
4
|
+
"description": "The official AdTogether Web SDK — reciprocal ad exchange to increase conversions and grow your audience.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/undecided2003/adtogether-web-sdk.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://www.ad-together.org",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/undecided2003/adtogether-web-sdk/issues"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"ads",
|
|
15
|
+
"ad-exchange",
|
|
16
|
+
"monetization",
|
|
17
|
+
"advertising",
|
|
18
|
+
"react",
|
|
19
|
+
"reciprocal",
|
|
20
|
+
"conversions"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"main": "./dist/index.js",
|
|
26
|
+
"module": "./dist/index.mjs",
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"require": "./dist/index.js",
|
|
32
|
+
"import": "./dist/index.mjs"
|
|
33
|
+
},
|
|
34
|
+
"./react": {
|
|
35
|
+
"types": "./dist/react/index.d.ts",
|
|
36
|
+
"require": "./dist/react/index.js",
|
|
37
|
+
"import": "./dist/react/index.mjs"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "tsup",
|
|
42
|
+
"dev": "tsup --watch"
|
|
43
|
+
},
|
|
44
|
+
"author": "AdTogether Team",
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"type": "commonjs",
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"react": "^19.2.4",
|
|
49
|
+
"react-dom": "^19.2.4"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/node": "^22.0.0",
|
|
53
|
+
"@types/react": "^19.2.14",
|
|
54
|
+
"@types/react-dom": "^19.2.3",
|
|
55
|
+
"tsup": "^8.5.1",
|
|
56
|
+
"typescript": "^5.3.3"
|
|
57
|
+
}
|
|
58
|
+
}
|