@gravity-ai/api 1.1.8 → 1.2.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.
@@ -29,6 +29,12 @@ interface PlacementObject {
29
29
  placement: Placement;
30
30
  /** Tracking ID for this specific ad slot (required) */
31
31
  placement_id: string;
32
+ /**
33
+ * Maximum character length for generated ad text in this slot.
34
+ * Overrides the placement-level display config baseline set in the dashboard.
35
+ * Minimum 50, maximum 5000.
36
+ */
37
+ max_ad_text_chars?: number;
32
38
  }
33
39
  /**
34
40
  * Represents a single message in a conversation
@@ -122,6 +128,27 @@ interface AdParams {
122
128
  relevancy?: number | null;
123
129
  /** Returns a test ad when true (no billing, for integration testing) */
124
130
  testAd?: boolean;
131
+ /**
132
+ * Whether the ads will be painted by a spec-capable renderer. Defaults to
133
+ * `true`; pass `false` if you render ad fields with your own markup so the
134
+ * server never serves a `renderer_spec` layout you won't display.
135
+ */
136
+ supportsSpec?: boolean;
137
+ /** Spec capability profile. Default: `"web1"`. */
138
+ specCapabilities?: string;
139
+ /**
140
+ * Declare support for iframe compositions (rich HTML creatives hosted in
141
+ * a sandboxed iframe). Defaults to `true`; the engine only serves frames
142
+ * to publishers it has enabled server-side. Set `false` to opt out, e.g.
143
+ * when rendering ads with your own markup.
144
+ */
145
+ enableFrames?: boolean;
146
+ /**
147
+ * @deprecated The engine picks the image layout per publisher. Only sent
148
+ * on test ads (`production` unset) to preview `image_left` /
149
+ * `image_right` / `image_top`.
150
+ */
151
+ adLayout?: AdLayout;
125
152
  /**
126
153
  * Additional custom fields for publisher-specific targeting
127
154
  * @description Any additional key-value pairs will be passed to the API
@@ -144,6 +171,115 @@ interface AdParams {
144
171
  * };
145
172
  * ```
146
173
  */
174
+ /**
175
+ * A single field in a lead-form ad unit.
176
+ * Mirrors the engine's `LeadFormField` Pydantic model.
177
+ */
178
+ interface LeadFormField {
179
+ /** Field key (submitted as-is to /api/v1/lead). */
180
+ name: string;
181
+ /** Human-readable label shown above the input. */
182
+ label: string;
183
+ /** HTML input type. */
184
+ type?: 'email' | 'text' | 'tel' | 'url' | 'number' | 'textarea' | 'checkbox' | 'select';
185
+ required?: boolean;
186
+ placeholder?: string;
187
+ /** Options for `select` / `checkbox` group fields. */
188
+ options?: string[];
189
+ }
190
+ /**
191
+ * Per-field opt-ins for SDK-side identity pre-fill.
192
+ */
193
+ interface LeadFormPrefill {
194
+ email?: boolean;
195
+ phone?: boolean;
196
+ }
197
+ /**
198
+ * Lead-form envelope attached to an {@link Ad} when the campaign uses the
199
+ * `lead_form` renderer. Present on the ad response only when the campaign
200
+ * is configured as a lead-form ad unit.
201
+ */
202
+ interface LeadFormConfig {
203
+ /** Ordered list of form fields to render. */
204
+ fields: LeadFormField[];
205
+ /** Form headline. Falls back to {@link Ad.title}. */
206
+ headline?: string;
207
+ /** Short form sub-headline. Falls back to {@link Ad.adText}. */
208
+ description?: string;
209
+ /** Submit button label. Falls back to {@link Ad.cta}. */
210
+ cta_text?: string;
211
+ /** Message shown after a successful submission. */
212
+ success_message?: string;
213
+ /** Fine-print privacy text rendered beneath the form. */
214
+ privacy_text?: string;
215
+ /** If set, a required consent checkbox is rendered with this label. */
216
+ consent_text?: string;
217
+ /** Optional URL to redirect the user to after a successful submission. */
218
+ success_redirect_url?: string;
219
+ /**
220
+ * How the SDK should present the form. SDK default is
221
+ * `modal-bottom-right` — the trigger remains in the publisher's slot and
222
+ * the form opens as a floating card pinned to the bottom-right.
223
+ * `inline` — full form rendered in-place inside the publisher slot.
224
+ * `modal-center` — full-screen overlay, form centered.
225
+ * `modal-bottom-right` — floating card pinned to the bottom-right.
226
+ */
227
+ display?: 'inline' | 'modal-center' | 'modal-bottom-right';
228
+ /** Per-field SDK identity pre-fill opt-ins. Optional. */
229
+ prefill?: LeadFormPrefill;
230
+ /** Endpoint the SDK POSTs the filled form to. */
231
+ submit_url: string;
232
+ }
233
+ /** A field on the ad payload that a renderer-spec node can bind to. */
234
+ type RendererSpecAdField = 'adText' | 'title' | 'cta' | 'brandName' | 'url' | 'favicon' | 'brandImage';
235
+ type RendererSpecNodeType = 'box' | 'text' | 'image' | 'link';
236
+ /**
237
+ * A single node in a server-delivered renderer spec. Pure data — nodes map
238
+ * to a fixed whitelist of HTML tags; SpecRenderer-capable SDKs
239
+ * (e.g. @gravity-ai/ui) interpret the tree into DOM.
240
+ */
241
+ interface RendererSpecNode {
242
+ type: RendererSpecNodeType;
243
+ /** Inline CSS. Values may reference theme tokens, e.g. "hsl(var(--primary))". */
244
+ style?: Record<string, string | number | boolean>;
245
+ /** Child nodes (box/link). */
246
+ children?: RendererSpecNode[];
247
+ /** Bind this node's content to an ad field (text content / image src / link href). */
248
+ bind?: RendererSpecAdField;
249
+ /** Static/template text for `text` nodes. Supports `{field}` placeholders. */
250
+ text?: string;
251
+ /** Static image src for `image` nodes (overridden by `bind`). */
252
+ src?: string;
253
+ /** Static href for `link` nodes (defaults to the ad's click/landing URL). */
254
+ href?: string;
255
+ /** Only render this node (and its subtree) when this ad field is non-empty. */
256
+ showIf?: RendererSpecAdField;
257
+ }
258
+ /**
259
+ * Server-delivered ad-unit layout — a declarative JSON tree the engine
260
+ * attaches per placement. Present only when the placement has a configured
261
+ * design and the request opted in; absent = the SDK uses its built-in look.
262
+ */
263
+ interface RendererSpec {
264
+ /** Spec format version. Current: 1. */
265
+ version: 1;
266
+ /** Optional human label for the unit. */
267
+ name?: string;
268
+ /** Root node of the layout tree. */
269
+ root: RendererSpecNode;
270
+ }
271
+ type AdLayout = 'image_left' | 'image_right' | 'image_top';
272
+ /**
273
+ * How the slot should paint the ad. `iframe`: host `frameUrl` in a sandboxed
274
+ * iframe, painting `fallback` if it fails. `spec`: paint `renderer_spec`
275
+ * (`layout` set for image layouts). `native`: the SDK's built-in look.
276
+ */
277
+ interface RenderEnvelope {
278
+ mode: 'iframe' | 'spec' | 'native';
279
+ frameUrl?: string;
280
+ fallback?: 'spec' | 'native';
281
+ layout?: AdLayout;
282
+ }
147
283
  interface Ad {
148
284
  /** The advertisement copy text */
149
285
  adText: string;
@@ -157,6 +293,10 @@ interface Ad {
157
293
  url?: string;
158
294
  /** Favicon URL */
159
295
  favicon?: string;
296
+ /** Ad image URL (campaign image), bound by image-layout specs */
297
+ brandImage?: string;
298
+ /** Render envelope: which mode the slot should paint this ad in */
299
+ render?: RenderEnvelope;
160
300
  /** Impression tracking URL - fire this when ad is displayed */
161
301
  impUrl?: string;
162
302
  /** Click-through tracking URL - use this as href for ad clicks */
@@ -173,6 +313,20 @@ interface Ad {
173
313
  composition_mode?: string;
174
314
  /** Full composition envelope for SDK rendering */
175
315
  composition?: Record<string, unknown>;
316
+ /**
317
+ * Server-delivered ad-unit layout painted by a SpecRenderer-capable SDK
318
+ * (e.g. @gravity-ai/ui). May arrive as the object or a JSON string.
319
+ */
320
+ renderer_spec?: RendererSpec | string;
321
+ /** Campaign identifier. Present on every ad response from the engine. */
322
+ campaignId?: string;
323
+ /**
324
+ * Lead-form envelope. Present only when the served campaign is configured
325
+ * as a `lead_form` ad unit. When set, render the configured form using the
326
+ * {@link LeadFormConfig} fields and POST the filled values to
327
+ * `leadForm.submit_url`.
328
+ */
329
+ leadForm?: LeadFormConfig;
176
330
  }
177
331
  /**
178
332
  * Error response structure from the Gravity API
@@ -206,6 +360,17 @@ interface GravityContextOverrides {
206
360
  } & Record<string, unknown>;
207
361
  /** Device field overrides (timezone, locale, etc.) */
208
362
  device?: Record<string, unknown>;
363
+ /**
364
+ * Explicit consent signal. When omitted in a browser, the SDK reads the
365
+ * page's IAB CMP APIs (`__tcfapi` / `__uspapi`) and attaches the settled
366
+ * decision automatically. Pass this to override, or in server-side
367
+ * runtimes where no CMP is readable.
368
+ */
369
+ consent?: {
370
+ gdprApplies?: boolean;
371
+ tcfString?: string;
372
+ usPrivacy?: string;
373
+ };
209
374
  }
210
375
  /** The context object returned by `gravityContext()` and sent in the request body. */
211
376
  interface GravityContext {
@@ -214,6 +379,16 @@ interface GravityContext {
214
379
  id: string;
215
380
  } & Record<string, unknown>;
216
381
  device: Record<string, unknown>;
382
+ /**
383
+ * End-user privacy/consent signal. Auto-detected from the page's CMP
384
+ * (`window.__tcfapi` / `window.__uspapi`) in browsers; callers can
385
+ * override via `GravityContextOverrides.consent`.
386
+ */
387
+ consent?: {
388
+ gdprApplies?: boolean;
389
+ tcfString?: string;
390
+ usPrivacy?: string;
391
+ };
217
392
  }
218
393
  /** Options for `gravityAds()`. */
219
394
  interface GravityAdsOptions {
@@ -221,7 +396,7 @@ interface GravityAdsOptions {
221
396
  apiKey?: string;
222
397
  /** Gravity ad endpoint URL. Defaults to production. */
223
398
  gravityApi?: string;
224
- /** Abort after this many ms. Default: `3000`. */
399
+ /** Abort after this many ms. Default: `4000`. */
225
400
  timeoutMs?: number;
226
401
  /** Minimum relevancy threshold (0-1). Default: `0.2`. */
227
402
  relevancy?: number;
@@ -230,8 +405,32 @@ interface GravityAdsOptions {
230
405
  * Pass `production: true` when you're ready to go live.
231
406
  */
232
407
  production?: boolean;
408
+ /**
409
+ * Test-only: when `true` the engine returns a default Gravity test ad
410
+ * instead of a 204 no-fill, so the slot always has something to render.
411
+ * Ignored when `production: true`.
412
+ */
413
+ alwaysReturn?: boolean;
233
414
  /** Topics to exclude from ad matching. */
234
415
  excludedTopics?: string[];
416
+ /**
417
+ * Whether the ads will be painted by a spec-capable renderer (e.g. the
418
+ * `@gravity-ai/react` / `@gravity-ai/ui` SpecRenderer). Defaults to `true`.
419
+ * Pass `false` if you render ad fields with your own markup so the server
420
+ * never serves (or attributes) a `renderer_spec` layout you won't display.
421
+ */
422
+ supportsSpec?: boolean;
423
+ /** Spec capability profile sent when `supportsSpec` is on. Default: `"web1"`. */
424
+ specCapabilities?: string;
425
+ /**
426
+ * Declare support for iframe compositions (rich HTML creatives hosted in
427
+ * a sandboxed iframe). Defaults to `true`; the engine only serves frames
428
+ * to publishers it has enabled server-side. Set `false` to opt out, e.g.
429
+ * when rendering ads with your own markup.
430
+ */
431
+ enableFrames?: boolean;
432
+ /** @deprecated See {@link AdParams.adLayout}. */
433
+ adLayout?: AdLayout;
235
434
  }
236
435
  /** Result returned by `gravityAds()`. Never throws. */
237
436
  interface GravityAdsResult {
@@ -265,4 +464,4 @@ interface IncomingAdRequest {
265
464
  ip?: string;
266
465
  }
267
466
 
268
- export type { AdParams as A, DeviceObject as D, GravityAdsOptions as G, IncomingAdRequest as I, MessageObject as M, PlacementObject as P, Role as R, UserObject as U, GravityAdsResult as a, GravityContextOverrides as b, GravityContext as c, Ad as d, ApiErrorResponse as e, Placement as f, Gender as g };
467
+ export type { AdParams as A, DeviceObject as D, GravityAdsOptions as G, IncomingAdRequest as I, LeadFormField as L, MessageObject as M, PlacementObject as P, RenderEnvelope as R, UserObject as U, GravityAdsResult as a, GravityContextOverrides as b, GravityContext as c, Ad as d, AdLayout as e, LeadFormPrefill as f, LeadFormConfig as g, ApiErrorResponse as h, Placement as i, Role as j, Gender as k };
@@ -29,6 +29,12 @@ interface PlacementObject {
29
29
  placement: Placement;
30
30
  /** Tracking ID for this specific ad slot (required) */
31
31
  placement_id: string;
32
+ /**
33
+ * Maximum character length for generated ad text in this slot.
34
+ * Overrides the placement-level display config baseline set in the dashboard.
35
+ * Minimum 50, maximum 5000.
36
+ */
37
+ max_ad_text_chars?: number;
32
38
  }
33
39
  /**
34
40
  * Represents a single message in a conversation
@@ -122,6 +128,27 @@ interface AdParams {
122
128
  relevancy?: number | null;
123
129
  /** Returns a test ad when true (no billing, for integration testing) */
124
130
  testAd?: boolean;
131
+ /**
132
+ * Whether the ads will be painted by a spec-capable renderer. Defaults to
133
+ * `true`; pass `false` if you render ad fields with your own markup so the
134
+ * server never serves a `renderer_spec` layout you won't display.
135
+ */
136
+ supportsSpec?: boolean;
137
+ /** Spec capability profile. Default: `"web1"`. */
138
+ specCapabilities?: string;
139
+ /**
140
+ * Declare support for iframe compositions (rich HTML creatives hosted in
141
+ * a sandboxed iframe). Defaults to `true`; the engine only serves frames
142
+ * to publishers it has enabled server-side. Set `false` to opt out, e.g.
143
+ * when rendering ads with your own markup.
144
+ */
145
+ enableFrames?: boolean;
146
+ /**
147
+ * @deprecated The engine picks the image layout per publisher. Only sent
148
+ * on test ads (`production` unset) to preview `image_left` /
149
+ * `image_right` / `image_top`.
150
+ */
151
+ adLayout?: AdLayout;
125
152
  /**
126
153
  * Additional custom fields for publisher-specific targeting
127
154
  * @description Any additional key-value pairs will be passed to the API
@@ -144,6 +171,115 @@ interface AdParams {
144
171
  * };
145
172
  * ```
146
173
  */
174
+ /**
175
+ * A single field in a lead-form ad unit.
176
+ * Mirrors the engine's `LeadFormField` Pydantic model.
177
+ */
178
+ interface LeadFormField {
179
+ /** Field key (submitted as-is to /api/v1/lead). */
180
+ name: string;
181
+ /** Human-readable label shown above the input. */
182
+ label: string;
183
+ /** HTML input type. */
184
+ type?: 'email' | 'text' | 'tel' | 'url' | 'number' | 'textarea' | 'checkbox' | 'select';
185
+ required?: boolean;
186
+ placeholder?: string;
187
+ /** Options for `select` / `checkbox` group fields. */
188
+ options?: string[];
189
+ }
190
+ /**
191
+ * Per-field opt-ins for SDK-side identity pre-fill.
192
+ */
193
+ interface LeadFormPrefill {
194
+ email?: boolean;
195
+ phone?: boolean;
196
+ }
197
+ /**
198
+ * Lead-form envelope attached to an {@link Ad} when the campaign uses the
199
+ * `lead_form` renderer. Present on the ad response only when the campaign
200
+ * is configured as a lead-form ad unit.
201
+ */
202
+ interface LeadFormConfig {
203
+ /** Ordered list of form fields to render. */
204
+ fields: LeadFormField[];
205
+ /** Form headline. Falls back to {@link Ad.title}. */
206
+ headline?: string;
207
+ /** Short form sub-headline. Falls back to {@link Ad.adText}. */
208
+ description?: string;
209
+ /** Submit button label. Falls back to {@link Ad.cta}. */
210
+ cta_text?: string;
211
+ /** Message shown after a successful submission. */
212
+ success_message?: string;
213
+ /** Fine-print privacy text rendered beneath the form. */
214
+ privacy_text?: string;
215
+ /** If set, a required consent checkbox is rendered with this label. */
216
+ consent_text?: string;
217
+ /** Optional URL to redirect the user to after a successful submission. */
218
+ success_redirect_url?: string;
219
+ /**
220
+ * How the SDK should present the form. SDK default is
221
+ * `modal-bottom-right` — the trigger remains in the publisher's slot and
222
+ * the form opens as a floating card pinned to the bottom-right.
223
+ * `inline` — full form rendered in-place inside the publisher slot.
224
+ * `modal-center` — full-screen overlay, form centered.
225
+ * `modal-bottom-right` — floating card pinned to the bottom-right.
226
+ */
227
+ display?: 'inline' | 'modal-center' | 'modal-bottom-right';
228
+ /** Per-field SDK identity pre-fill opt-ins. Optional. */
229
+ prefill?: LeadFormPrefill;
230
+ /** Endpoint the SDK POSTs the filled form to. */
231
+ submit_url: string;
232
+ }
233
+ /** A field on the ad payload that a renderer-spec node can bind to. */
234
+ type RendererSpecAdField = 'adText' | 'title' | 'cta' | 'brandName' | 'url' | 'favicon' | 'brandImage';
235
+ type RendererSpecNodeType = 'box' | 'text' | 'image' | 'link';
236
+ /**
237
+ * A single node in a server-delivered renderer spec. Pure data — nodes map
238
+ * to a fixed whitelist of HTML tags; SpecRenderer-capable SDKs
239
+ * (e.g. @gravity-ai/ui) interpret the tree into DOM.
240
+ */
241
+ interface RendererSpecNode {
242
+ type: RendererSpecNodeType;
243
+ /** Inline CSS. Values may reference theme tokens, e.g. "hsl(var(--primary))". */
244
+ style?: Record<string, string | number | boolean>;
245
+ /** Child nodes (box/link). */
246
+ children?: RendererSpecNode[];
247
+ /** Bind this node's content to an ad field (text content / image src / link href). */
248
+ bind?: RendererSpecAdField;
249
+ /** Static/template text for `text` nodes. Supports `{field}` placeholders. */
250
+ text?: string;
251
+ /** Static image src for `image` nodes (overridden by `bind`). */
252
+ src?: string;
253
+ /** Static href for `link` nodes (defaults to the ad's click/landing URL). */
254
+ href?: string;
255
+ /** Only render this node (and its subtree) when this ad field is non-empty. */
256
+ showIf?: RendererSpecAdField;
257
+ }
258
+ /**
259
+ * Server-delivered ad-unit layout — a declarative JSON tree the engine
260
+ * attaches per placement. Present only when the placement has a configured
261
+ * design and the request opted in; absent = the SDK uses its built-in look.
262
+ */
263
+ interface RendererSpec {
264
+ /** Spec format version. Current: 1. */
265
+ version: 1;
266
+ /** Optional human label for the unit. */
267
+ name?: string;
268
+ /** Root node of the layout tree. */
269
+ root: RendererSpecNode;
270
+ }
271
+ type AdLayout = 'image_left' | 'image_right' | 'image_top';
272
+ /**
273
+ * How the slot should paint the ad. `iframe`: host `frameUrl` in a sandboxed
274
+ * iframe, painting `fallback` if it fails. `spec`: paint `renderer_spec`
275
+ * (`layout` set for image layouts). `native`: the SDK's built-in look.
276
+ */
277
+ interface RenderEnvelope {
278
+ mode: 'iframe' | 'spec' | 'native';
279
+ frameUrl?: string;
280
+ fallback?: 'spec' | 'native';
281
+ layout?: AdLayout;
282
+ }
147
283
  interface Ad {
148
284
  /** The advertisement copy text */
149
285
  adText: string;
@@ -157,6 +293,10 @@ interface Ad {
157
293
  url?: string;
158
294
  /** Favicon URL */
159
295
  favicon?: string;
296
+ /** Ad image URL (campaign image), bound by image-layout specs */
297
+ brandImage?: string;
298
+ /** Render envelope: which mode the slot should paint this ad in */
299
+ render?: RenderEnvelope;
160
300
  /** Impression tracking URL - fire this when ad is displayed */
161
301
  impUrl?: string;
162
302
  /** Click-through tracking URL - use this as href for ad clicks */
@@ -173,6 +313,20 @@ interface Ad {
173
313
  composition_mode?: string;
174
314
  /** Full composition envelope for SDK rendering */
175
315
  composition?: Record<string, unknown>;
316
+ /**
317
+ * Server-delivered ad-unit layout painted by a SpecRenderer-capable SDK
318
+ * (e.g. @gravity-ai/ui). May arrive as the object or a JSON string.
319
+ */
320
+ renderer_spec?: RendererSpec | string;
321
+ /** Campaign identifier. Present on every ad response from the engine. */
322
+ campaignId?: string;
323
+ /**
324
+ * Lead-form envelope. Present only when the served campaign is configured
325
+ * as a `lead_form` ad unit. When set, render the configured form using the
326
+ * {@link LeadFormConfig} fields and POST the filled values to
327
+ * `leadForm.submit_url`.
328
+ */
329
+ leadForm?: LeadFormConfig;
176
330
  }
177
331
  /**
178
332
  * Error response structure from the Gravity API
@@ -206,6 +360,17 @@ interface GravityContextOverrides {
206
360
  } & Record<string, unknown>;
207
361
  /** Device field overrides (timezone, locale, etc.) */
208
362
  device?: Record<string, unknown>;
363
+ /**
364
+ * Explicit consent signal. When omitted in a browser, the SDK reads the
365
+ * page's IAB CMP APIs (`__tcfapi` / `__uspapi`) and attaches the settled
366
+ * decision automatically. Pass this to override, or in server-side
367
+ * runtimes where no CMP is readable.
368
+ */
369
+ consent?: {
370
+ gdprApplies?: boolean;
371
+ tcfString?: string;
372
+ usPrivacy?: string;
373
+ };
209
374
  }
210
375
  /** The context object returned by `gravityContext()` and sent in the request body. */
211
376
  interface GravityContext {
@@ -214,6 +379,16 @@ interface GravityContext {
214
379
  id: string;
215
380
  } & Record<string, unknown>;
216
381
  device: Record<string, unknown>;
382
+ /**
383
+ * End-user privacy/consent signal. Auto-detected from the page's CMP
384
+ * (`window.__tcfapi` / `window.__uspapi`) in browsers; callers can
385
+ * override via `GravityContextOverrides.consent`.
386
+ */
387
+ consent?: {
388
+ gdprApplies?: boolean;
389
+ tcfString?: string;
390
+ usPrivacy?: string;
391
+ };
217
392
  }
218
393
  /** Options for `gravityAds()`. */
219
394
  interface GravityAdsOptions {
@@ -221,7 +396,7 @@ interface GravityAdsOptions {
221
396
  apiKey?: string;
222
397
  /** Gravity ad endpoint URL. Defaults to production. */
223
398
  gravityApi?: string;
224
- /** Abort after this many ms. Default: `3000`. */
399
+ /** Abort after this many ms. Default: `4000`. */
225
400
  timeoutMs?: number;
226
401
  /** Minimum relevancy threshold (0-1). Default: `0.2`. */
227
402
  relevancy?: number;
@@ -230,8 +405,32 @@ interface GravityAdsOptions {
230
405
  * Pass `production: true` when you're ready to go live.
231
406
  */
232
407
  production?: boolean;
408
+ /**
409
+ * Test-only: when `true` the engine returns a default Gravity test ad
410
+ * instead of a 204 no-fill, so the slot always has something to render.
411
+ * Ignored when `production: true`.
412
+ */
413
+ alwaysReturn?: boolean;
233
414
  /** Topics to exclude from ad matching. */
234
415
  excludedTopics?: string[];
416
+ /**
417
+ * Whether the ads will be painted by a spec-capable renderer (e.g. the
418
+ * `@gravity-ai/react` / `@gravity-ai/ui` SpecRenderer). Defaults to `true`.
419
+ * Pass `false` if you render ad fields with your own markup so the server
420
+ * never serves (or attributes) a `renderer_spec` layout you won't display.
421
+ */
422
+ supportsSpec?: boolean;
423
+ /** Spec capability profile sent when `supportsSpec` is on. Default: `"web1"`. */
424
+ specCapabilities?: string;
425
+ /**
426
+ * Declare support for iframe compositions (rich HTML creatives hosted in
427
+ * a sandboxed iframe). Defaults to `true`; the engine only serves frames
428
+ * to publishers it has enabled server-side. Set `false` to opt out, e.g.
429
+ * when rendering ads with your own markup.
430
+ */
431
+ enableFrames?: boolean;
432
+ /** @deprecated See {@link AdParams.adLayout}. */
433
+ adLayout?: AdLayout;
235
434
  }
236
435
  /** Result returned by `gravityAds()`. Never throws. */
237
436
  interface GravityAdsResult {
@@ -265,4 +464,4 @@ interface IncomingAdRequest {
265
464
  ip?: string;
266
465
  }
267
466
 
268
- export type { AdParams as A, DeviceObject as D, GravityAdsOptions as G, IncomingAdRequest as I, MessageObject as M, PlacementObject as P, Role as R, UserObject as U, GravityAdsResult as a, GravityContextOverrides as b, GravityContext as c, Ad as d, ApiErrorResponse as e, Placement as f, Gender as g };
467
+ export type { AdParams as A, DeviceObject as D, GravityAdsOptions as G, IncomingAdRequest as I, LeadFormField as L, MessageObject as M, PlacementObject as P, RenderEnvelope as R, UserObject as U, GravityAdsResult as a, GravityContextOverrides as b, GravityContext as c, Ad as d, AdLayout as e, LeadFormPrefill as f, LeadFormConfig as g, ApiErrorResponse as h, Placement as i, Role as j, Gender as k };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ai/api",
3
- "version": "1.1.8",
3
+ "version": "1.2.0",
4
4
  "description": "Gravity JS SDK for retrieving targeted advertisements",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",