@wavebirdai/api 0.1.0-beta.17 → 0.1.0-beta.18
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 +6 -1
- package/README.md +2 -2
- package/dist/browser.js +3 -1
- package/docs/web/generation.md +1 -1
- package/docs/web/nextjs.md +1 -1
- package/docs/web/reference.md +6 -2
- package/package.json +1 -1
- package/src/browser.js +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.18
|
|
4
|
+
|
|
5
|
+
- Prevent fractional clipping of the hosted ad frame at some device scales.
|
|
6
|
+
- Correct the consent language guidance: browser preference comes first, then the publisher fallback.
|
|
7
|
+
|
|
3
8
|
## 0.1.0-beta.17
|
|
4
9
|
|
|
5
10
|
- Optional `consentLocale` and `consentTheme` browser settings for the hosted consent dialog.
|
|
@@ -29,6 +34,6 @@
|
|
|
29
34
|
- Generation examples that preserve the app's request, response display and cancellation.
|
|
30
35
|
- Updated package description, documentation link and search keywords.
|
|
31
36
|
|
|
32
|
-
|
|
37
|
+
At `0.1.0-beta.13`, runtime code, exports and generator templates were unchanged from `0.1.0-beta.12`. Existing integrations remain on their selected version until explicitly upgraded.
|
|
33
38
|
|
|
34
39
|
The Python `0.1.0b9` source is included in the repository. Its released wheel is unchanged and is installed separately from npm.
|
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ Use Node.js 20 or later on your server.
|
|
|
22
22
|
2. **Install the package.** Run this in your app's terminal, in the folder containing `package.json`:
|
|
23
23
|
|
|
24
24
|
```sh
|
|
25
|
-
npm install @wavebirdai/api@0.1.0-beta.
|
|
25
|
+
npm install @wavebirdai/api@0.1.0-beta.18
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
3. **Save the Server ENV from Overview, Integration step 2.** The key-only download is not the full configuration. Keep `WAVEBIRD_SECRET_KEY` and the stable, project-specific `WAVEBIRD_PREFERENCE_SECRET` out of browser code and Git. Include the saved `WAVEBIRD_PUBLIC_ORIGINS`.
|
|
@@ -41,7 +41,7 @@ Use `@wavebirdai/api/server` on the server and `@wavebirdai/api/browser` for the
|
|
|
41
41
|
|
|
42
42
|
## Consent appearance
|
|
43
43
|
|
|
44
|
-
The wavebird dialog follows the browser language
|
|
44
|
+
The wavebird dialog follows the visitor's browser language. Optional `consentLocale` supplies a fallback before English; `consentTheme` adjusts appearance. Consent choices and permissions stay unchanged. See [consent appearance](https://github.com/wavebird-ai/api/blob/main/docs/web/reference.md#consent-appearance) for supported languages and options.
|
|
45
45
|
|
|
46
46
|
## Update an existing integration
|
|
47
47
|
|
package/dist/browser.js
CHANGED
|
@@ -97,7 +97,9 @@ export function createPublisherAds(options) {
|
|
|
97
97
|
// Renderer failures originate in a child mount and do not bubble.
|
|
98
98
|
slot.addEventListener?.("ad:render_failed", onRenderFailure, true);
|
|
99
99
|
slot.setAttribute("aria-label", "Sponsored placement");
|
|
100
|
-
|
|
100
|
+
// The hosted creative clips its own contents. Clipping this full-width mount
|
|
101
|
+
// loses a fractional pixel at some device scales and invalidates visibility.
|
|
102
|
+
slot.style.cssText = "width:100%;height:100%;overflow:visible;margin:0 auto";
|
|
101
103
|
target.append(slot);
|
|
102
104
|
const openPrivacySettings = () => { if (!disposed) sponsor?.openPrivacySettings(); };
|
|
103
105
|
privacyTarget?.addEventListener("click", openPrivacySettings);
|
package/docs/web/generation.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Connect generation to the displayed result
|
|
2
2
|
|
|
3
|
-
These are connection helpers, not complete apps. Use the same installed `@wavebirdai/api@0.1.0-beta.
|
|
3
|
+
These are connection helpers, not complete apps. Use the same installed `@wavebirdai/api@0.1.0-beta.18` as your server routes.
|
|
4
4
|
|
|
5
5
|
- `ads` is the instance for this surface, returned by `createPublisherAds` or the generated component's `onReady` callback.
|
|
6
6
|
- `sendExistingRequest` sends your existing authenticated model request. Merge the provided headers into its headers and preserve its body and abort signal. Call the route wrapped by `withGeneration`.
|
package/docs/web/nextjs.md
CHANGED
|
@@ -11,7 +11,7 @@ If your app sets Content Security Policy, allow `https://api.wavebird.ai` in its
|
|
|
11
11
|
From the folder containing `package.json`:
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
|
-
npm install @wavebirdai/api@0.1.0-beta.
|
|
14
|
+
npm install @wavebirdai/api@0.1.0-beta.18 server-only
|
|
15
15
|
./node_modules/.bin/wavebird-next init --lang ts --root . --app-dir src/app
|
|
16
16
|
```
|
|
17
17
|
|
package/docs/web/reference.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Web integration reference
|
|
2
2
|
|
|
3
|
-
Applies to `@wavebirdai/api@0.1.0-beta.
|
|
3
|
+
Applies to `@wavebirdai/api@0.1.0-beta.18`. [Start with the integration steps](../../README.md#set-up-javascript-or-typescript).
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
`@wavebirdai/api/server` exports `createPublisherServer`. Configure it with server-only Project ID, Server Test or production Key, preference signing secret, the publisher's real request authorization function, exact `publicOrigins`, and the saved project/placement values shown in the dashboard. The origin list is required. The package compares the browser Origin with a configured public origin whose host matches the route Host, even when Next.js or a proxy gives the route an internal URL. `localhost` and `127.0.0.1` are separate origins, and each port and scheme must match exactly; HTTP loopback is available only with a Server Test Key. A production key also requires its separately approved project and wavebird server authority. Omit `bidfloor` and `bidfloorCurrency` to inherit saved pricing. An explicit override supplies both a nonnegative amount, including zero, and a three-letter currency; the API validates it against the saved project. It returns authenticated `placementPOST`, `consentGET`, `consentPOST`, and `withGeneration` handlers, plus the server-only `reportGeneration(jobId, event)` method. The helper constructs the existing `/v1/placements`, `/v1/consent`, and `/v1/jobs/{id}/generation/{event}` requests; it does not introduce a new wavebird protocol. The wavebird API remains authoritative for saved scope, creative formats, duration, fallback, and financial classification.
|
|
@@ -32,7 +32,11 @@ Use the existing `generationId` in the server `onLifecycle` observer to correlat
|
|
|
32
32
|
|
|
33
33
|
## Consent appearance
|
|
34
34
|
|
|
35
|
-
The
|
|
35
|
+
The hosted renderer uses the first supported language in the visitor's browser preferences. Optional `consentLocale: "de-DE"` on `createPublisherAds` is a fallback if none matches. English is the final fallback. Omit it or use `"auto"` to keep the English fallback.
|
|
36
|
+
|
|
37
|
+
Supported languages: English, Spanish, German, Japanese, French, Portuguese, Russian, Italian, Dutch, Polish, Turkish, Indonesian, Chinese, Persian, Czech, Vietnamese, Korean, Arabic, Ukrainian and Hungarian. Chinese includes simplified and traditional script. Korean uses South Korean wording. Arabic and Persian use right-to-left text.
|
|
38
|
+
|
|
39
|
+
Language support is delivered by the hosted renderer. Browser preferences take priority over the publisher fallback.
|
|
36
40
|
|
|
37
41
|
The optional `consentTheme` accepts `accentColor`, `backgroundColor` and `textColor` as six-digit hex colors, `fontFamily` as existing font names, `radius` from 0 to 20, and `spacing` from 12 to 32 pixels. Low-contrast colors fall back to readable colors. No fonts are downloaded. For example:
|
|
38
42
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wavebirdai/api",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.18",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "JavaScript and TypeScript integration for wavebird Banner, Native and Clip ads, with consent and generation lifecycle handling.",
|
package/src/browser.js
CHANGED
|
@@ -97,7 +97,9 @@ export function createPublisherAds(options) {
|
|
|
97
97
|
// Renderer failures originate in a child mount and do not bubble.
|
|
98
98
|
slot.addEventListener?.("ad:render_failed", onRenderFailure, true);
|
|
99
99
|
slot.setAttribute("aria-label", "Sponsored placement");
|
|
100
|
-
|
|
100
|
+
// The hosted creative clips its own contents. Clipping this full-width mount
|
|
101
|
+
// loses a fractional pixel at some device scales and invalidates visibility.
|
|
102
|
+
slot.style.cssText = "width:100%;height:100%;overflow:visible;margin:0 auto";
|
|
101
103
|
target.append(slot);
|
|
102
104
|
const openPrivacySettings = () => { if (!disposed) sponsor?.openPrivacySettings(); };
|
|
103
105
|
privacyTarget?.addEventListener("click", openPrivacySettings);
|