Embed

API Reference

Complete reference for the Activoice embed configuration

Activoice.init(config)

Initializes one embed instance inside the target container.

If the container already contains an active embed (for example after a client-side navigation), it is destroyed and replaced with a fresh instance.

window.Activoice.init(config: ActivoiceEmbedConfig): void

ActivoiceEmbedConfig

The root configuration object passed to Activoice.init().

PropertyTypeRequiredDescription
containerstringCSS selector of the host element (e.g. '#av-embed-container'). Must match exactly one element in the DOM at the time init() is called.
campaignIdstringSlug or identifier of the campaign to embed. Visible in the backoffice URL and in the embed panel.
embedOptionsEmbedOptionsOptional display and behavior settings.
campaignOverridesCampaignOverridesOptional overrides applied on top of the campaign configuration defined in the backoffice.

EmbedOptions

All fields are optional. Omitting a field uses the default value.

PropertyTypeDefaultDescription
spinnerColorstring'#fed13a'CSS color of the loading spinner shown before the campaign is ready. Accepts any valid CSS color value (hex, rgb(), named colors, etc.).
initialPage'steps' | 'landing''steps'Controls which page of the campaign is shown first. 'steps' opens directly on the action flow. 'landing' shows the campaign landing page.
displayMode'inline' | 'fullHeight''inline'Height management strategy. 'inline' updates the iframe height in pixels each time the content resizes. 'fullHeight' sets height: 100% so the iframe fills its container — useful in sidebars or fixed-height panels.
withToolbarbooleanfalseRenders the navigation toolbar inside the embed (back button, step indicator). Disabled by default for a seamless embedded look.
withBackgroundbooleanfalseApplies the campaign's background color to the iframe body. When disabled, the background is transparent so the host page shows through.
withPaddingbooleanfalseAdds horizontal padding to the campaign content area.
bypassCampaignStateCheckbooleanfalseWhen true, the campaign renders even if it is in draft or ended state. Intended for preview and testing purposes only — do not enable in production.

CampaignOverrides

Overrides applied on top of the campaign configuration defined in the backoffice.

interface CampaignOverrides {
  recipients?: Recipient[]        // Global recipient override for all interpellations
  interpellations?: Array<{
    id: string                    // UUID of the interpellation to override
    recipients?: Recipient[]      // Per-interpellation override (takes priority)
  }>
}

Recipient resolution order

Recipients are resolved per interpellation with the following priority:

  1. Per-interpellation overrideinterpellations[].recipients if provided for that entry
  2. Root-level override — top-level recipients applied to all interpellations that don't have their own override
  3. Backoffice configuration — original recipients preserved when no override applies
When interpellations is provided, only the listed interpellations are shown — any interpellation whose id is not included is hidden from the embed. Omit interpellations entirely to keep all interpellations visible.
The root-level recipients is a convenient shortcut when you want to set the same recipients across all interpellations without repeating them in each entry.

Recipient

All fields are optional.

FieldTypeDescription
first_namestringFirst name of the recipient.
last_namestringLast name of the recipient.
gender'M' | 'F' | 'O'Gender: M (male), F (female), O (other / not specified). Used to personalize AI-generated messages.
display_titlestringTitle or role displayed to the user (e.g. 'Mayor of Lyon').
photo_urlstring | nullAbsolute URL of the recipient's photo.
emailstring | nullEmail address (used for email interpellation modes).
phone_numberstring | nullPhone number (used for call interpellation modes).
personal_linkstring | nullAbsolute URL to the recipient's personal or professional website.
facebook_pagestringAbsolute URL of the recipient's Facebook page.
twitter_handlestringTwitter/X handle, without the @ prefix.
instagram_handlestringInstagram handle, without the @ prefix.
linkedin_pagestringAbsolute URL of the recipient's LinkedIn profile.
tiktok_handlestringTikTok handle, without the @ prefix.
geo_typestring | nullType of geographic area (e.g. 'municipality', 'department'). Used for geospatial targeting when supporters search by location.
geo_idstring | nullIdentifier of the geographic area, matching the geo_type taxonomy.
party_namestring | nullFull name of the political party.
party_short_namestring | nullAbbreviated party name displayed in the UI.
custom_fieldsRecord<string, string>Arbitrary key-value pairs injected as extra variables into AI-generated message templates.

TypeScript types

Download the type definitions file and reference it in your project for full IDE autocompletion: activoice-embed.d.ts

This file is not versioned or distributed automatically. As the API evolves, you will need to re-download it and update your local copy manually.

Then point your tsconfig.json to it:

tsconfig.json
{
  "include": ["./activoice-embed.d.ts", "src/**/*"]
}
Copyright © 2026