@upeex/ads-sdk 1.1.13 → 1.1.14

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.
@@ -4,8 +4,10 @@ type Props = {
4
4
  baseUrl?: string;
5
5
  theme?: 'light' | 'dark';
6
6
  typeAds?: 'banner' | 'popup';
7
+ typeads?: string;
7
8
  style?: object;
8
9
  debug?: boolean;
9
10
  };
10
- export default function AdBanner({ client, slot, baseUrl, theme, typeAds, style, debug, }: Props): any;
11
+ export default function AdBanner({ client, slot, baseUrl, theme, typeAds, typeads, // Receive alias
12
+ style, debug, }: Props): any;
11
13
  export {};
package/dist/index.js CHANGED
@@ -79,7 +79,8 @@ async function fetchAd({ baseUrl, client, slot, debug = false, typeAds, }) {
79
79
  return ad;
80
80
  }
81
81
 
82
- function AdBanner({ client, slot, baseUrl = 'https://app.upeex.com.br/ad', theme = 'light', typeAds, style = {}, debug = false, }) {
82
+ function AdBanner({ client, slot, baseUrl = 'https://app.upeex.com.br/ad', theme = 'light', typeAds, typeads, // Receive alias
83
+ style = {}, debug = false, }) {
83
84
  const [ad, setAd] = useState(null);
84
85
  const [error, setError] = useState(null);
85
86
  const log = (...args) => {
@@ -89,9 +90,19 @@ function AdBanner({ client, slot, baseUrl = 'https://app.upeex.com.br/ad', theme
89
90
  useEffect(() => {
90
91
  let refreshTimer;
91
92
  const load = async () => {
93
+ var _a;
92
94
  try {
93
95
  log('Buscando anúncio', { client, slot });
94
- const data = await fetchAd({ baseUrl, client, slot, debug, typeAds });
96
+ // Normalize typeAds: prefer typeAds, fallback to typeads, default undefined.
97
+ // Ensure lowercase for backend compatibility (POPUP -> popup)
98
+ const effectiveTypeAds = (_a = (typeAds || typeads)) === null || _a === void 0 ? void 0 : _a.toLowerCase();
99
+ const data = await fetchAd({
100
+ baseUrl,
101
+ client,
102
+ slot,
103
+ debug,
104
+ typeAds: effectiveTypeAds,
105
+ });
95
106
  log('Resposta do servidor', data);
96
107
  if (!data || !data.image) {
97
108
  setError('Nenhum anúncio disponível');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@upeex/ads-sdk",
3
- "version": "1.1.13",
3
+ "version": "1.1.14",
4
4
  "description": "Upeex Ads SDK for React Native and universal apps",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",