@adtogether/web-sdk 0.3.2 → 0.4.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/CHANGELOG.md +5 -0
- package/dist/{chunk-EGEGGY7K.mjs → chunk-5UAFUJUK.mjs} +8 -3
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -3
- package/dist/index.mjs +1 -1
- package/dist/react/index.js +8 -3
- package/dist/react/index.mjs +1 -1
- package/package.json +1 -1
- package/src/core/AdTogether.ts +9 -3
- package/src/core/types.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## 0.4.0
|
|
2
|
+
* **Security**: Standardized `appId` as the primary identifier across all platforms.
|
|
3
|
+
* **Deprecation**: Formally deprecated `apiKey` in favor of `appId` to align with the AdTogether dashboard.
|
|
4
|
+
* **Sync**: Version parity (0.4.0) across all AdTogether SDKs.
|
|
5
|
+
|
|
1
6
|
## 0.3.2
|
|
2
7
|
* **Docs**: Added official Model Context Protocol (MCP) server integration instructions to README.
|
|
3
8
|
* **Sync**: Version parity (0.3.2) across all AdTogether SDKs.
|
|
@@ -12,7 +12,12 @@ var AdTogether = class _AdTogether {
|
|
|
12
12
|
}
|
|
13
13
|
static initialize(options) {
|
|
14
14
|
const sdk = _AdTogether.shared;
|
|
15
|
-
|
|
15
|
+
if (options.apiKey && !options.appId) {
|
|
16
|
+
console.warn('AdTogether: "apiKey" is deprecated. Please use "appId" instead.');
|
|
17
|
+
sdk.appId = options.apiKey;
|
|
18
|
+
} else {
|
|
19
|
+
sdk.appId = options.appId;
|
|
20
|
+
}
|
|
16
21
|
if (options.bundleId) {
|
|
17
22
|
sdk.bundleId = options.bundleId;
|
|
18
23
|
} else if (typeof window !== "undefined") {
|
|
@@ -41,7 +46,7 @@ var AdTogether = class _AdTogether {
|
|
|
41
46
|
}
|
|
42
47
|
try {
|
|
43
48
|
const sdk = _AdTogether.shared;
|
|
44
|
-
let url = `${sdk.baseUrl}/api/ads/serve?country=global&adUnitId=${adUnitId}&
|
|
49
|
+
let url = `${sdk.baseUrl}/api/ads/serve?country=global&adUnitId=${adUnitId}&appId=${sdk.appId}`;
|
|
45
50
|
if (adType) {
|
|
46
51
|
url += `&adType=${adType}`;
|
|
47
52
|
}
|
|
@@ -113,7 +118,7 @@ var AdTogether = class _AdTogether {
|
|
|
113
118
|
body: JSON.stringify({
|
|
114
119
|
adId,
|
|
115
120
|
token,
|
|
116
|
-
|
|
121
|
+
appId: _AdTogether.shared.appId,
|
|
117
122
|
..._AdTogether.shared.bundleId ? { bundleId: _AdTogether.shared.bundleId } : {},
|
|
118
123
|
// Send platform and environment to match Flutter SDK
|
|
119
124
|
platform: "web",
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -38,7 +38,12 @@ var AdTogether = class _AdTogether {
|
|
|
38
38
|
}
|
|
39
39
|
static initialize(options) {
|
|
40
40
|
const sdk = _AdTogether.shared;
|
|
41
|
-
|
|
41
|
+
if (options.apiKey && !options.appId) {
|
|
42
|
+
console.warn('AdTogether: "apiKey" is deprecated. Please use "appId" instead.');
|
|
43
|
+
sdk.appId = options.apiKey;
|
|
44
|
+
} else {
|
|
45
|
+
sdk.appId = options.appId;
|
|
46
|
+
}
|
|
42
47
|
if (options.bundleId) {
|
|
43
48
|
sdk.bundleId = options.bundleId;
|
|
44
49
|
} else if (typeof window !== "undefined") {
|
|
@@ -67,7 +72,7 @@ var AdTogether = class _AdTogether {
|
|
|
67
72
|
}
|
|
68
73
|
try {
|
|
69
74
|
const sdk = _AdTogether.shared;
|
|
70
|
-
let url = `${sdk.baseUrl}/api/ads/serve?country=global&adUnitId=${adUnitId}&
|
|
75
|
+
let url = `${sdk.baseUrl}/api/ads/serve?country=global&adUnitId=${adUnitId}&appId=${sdk.appId}`;
|
|
71
76
|
if (adType) {
|
|
72
77
|
url += `&adType=${adType}`;
|
|
73
78
|
}
|
|
@@ -139,7 +144,7 @@ var AdTogether = class _AdTogether {
|
|
|
139
144
|
body: JSON.stringify({
|
|
140
145
|
adId,
|
|
141
146
|
token,
|
|
142
|
-
|
|
147
|
+
appId: _AdTogether.shared.appId,
|
|
143
148
|
..._AdTogether.shared.bundleId ? { bundleId: _AdTogether.shared.bundleId } : {},
|
|
144
149
|
// Send platform and environment to match Flutter SDK
|
|
145
150
|
platform: "web",
|
package/dist/index.mjs
CHANGED
package/dist/react/index.js
CHANGED
|
@@ -42,7 +42,12 @@ var AdTogether = class _AdTogether {
|
|
|
42
42
|
}
|
|
43
43
|
static initialize(options) {
|
|
44
44
|
const sdk = _AdTogether.shared;
|
|
45
|
-
|
|
45
|
+
if (options.apiKey && !options.appId) {
|
|
46
|
+
console.warn('AdTogether: "apiKey" is deprecated. Please use "appId" instead.');
|
|
47
|
+
sdk.appId = options.apiKey;
|
|
48
|
+
} else {
|
|
49
|
+
sdk.appId = options.appId;
|
|
50
|
+
}
|
|
46
51
|
if (options.bundleId) {
|
|
47
52
|
sdk.bundleId = options.bundleId;
|
|
48
53
|
} else if (typeof window !== "undefined") {
|
|
@@ -71,7 +76,7 @@ var AdTogether = class _AdTogether {
|
|
|
71
76
|
}
|
|
72
77
|
try {
|
|
73
78
|
const sdk = _AdTogether.shared;
|
|
74
|
-
let url = `${sdk.baseUrl}/api/ads/serve?country=global&adUnitId=${adUnitId}&
|
|
79
|
+
let url = `${sdk.baseUrl}/api/ads/serve?country=global&adUnitId=${adUnitId}&appId=${sdk.appId}`;
|
|
75
80
|
if (adType) {
|
|
76
81
|
url += `&adType=${adType}`;
|
|
77
82
|
}
|
|
@@ -143,7 +148,7 @@ var AdTogether = class _AdTogether {
|
|
|
143
148
|
body: JSON.stringify({
|
|
144
149
|
adId,
|
|
145
150
|
token,
|
|
146
|
-
|
|
151
|
+
appId: _AdTogether.shared.appId,
|
|
147
152
|
..._AdTogether.shared.bundleId ? { bundleId: _AdTogether.shared.bundleId } : {},
|
|
148
153
|
// Send platform and environment to match Flutter SDK
|
|
149
154
|
platform: "web",
|
package/dist/react/index.mjs
CHANGED
package/package.json
CHANGED
package/src/core/AdTogether.ts
CHANGED
|
@@ -18,7 +18,13 @@ export class AdTogether {
|
|
|
18
18
|
|
|
19
19
|
static initialize(options: AdTogetherOptions) {
|
|
20
20
|
const sdk = AdTogether.shared;
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
if (options.apiKey && !options.appId) {
|
|
23
|
+
console.warn('AdTogether: "apiKey" is deprecated. Please use "appId" instead.');
|
|
24
|
+
sdk.appId = options.apiKey;
|
|
25
|
+
} else {
|
|
26
|
+
sdk.appId = options.appId;
|
|
27
|
+
}
|
|
22
28
|
|
|
23
29
|
if (options.bundleId) {
|
|
24
30
|
sdk.bundleId = options.bundleId;
|
|
@@ -57,7 +63,7 @@ export class AdTogether {
|
|
|
57
63
|
|
|
58
64
|
try {
|
|
59
65
|
const sdk = AdTogether.shared;
|
|
60
|
-
let url = `${sdk.baseUrl}/api/ads/serve?country=global&adUnitId=${adUnitId}&
|
|
66
|
+
let url = `${sdk.baseUrl}/api/ads/serve?country=global&adUnitId=${adUnitId}&appId=${sdk.appId}`;
|
|
61
67
|
if (adType) {
|
|
62
68
|
url += `&adType=${adType}`;
|
|
63
69
|
}
|
|
@@ -140,7 +146,7 @@ export class AdTogether {
|
|
|
140
146
|
body: JSON.stringify({
|
|
141
147
|
adId,
|
|
142
148
|
token,
|
|
143
|
-
|
|
149
|
+
appId: AdTogether.shared.appId,
|
|
144
150
|
...(AdTogether.shared.bundleId ? { bundleId: AdTogether.shared.bundleId } : {}),
|
|
145
151
|
// Send platform and environment to match Flutter SDK
|
|
146
152
|
platform: 'web',
|
package/src/core/types.ts
CHANGED
|
@@ -11,10 +11,13 @@ export interface AdModel {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export interface AdTogetherOptions {
|
|
14
|
+
/** The unique identifier for your application. */
|
|
14
15
|
appId?: string;
|
|
16
|
+
/** @deprecated Use appId instead */
|
|
15
17
|
apiKey?: string;
|
|
16
18
|
baseUrl?: string;
|
|
17
19
|
bundleId?: string;
|
|
18
20
|
/** Whether to show your own ads as fallback if no external ads are available. Defaults to true. */
|
|
19
21
|
allowSelfAds?: boolean;
|
|
20
22
|
}
|
|
23
|
+
|