Global

Methods

(async) isEnabled() → {Promise.<boolean>}

Fetches the current analytics enablement value for this browser.

Returns:
Type:
Promise.<boolean>

resolves to true if analytics are enabled, else false

setEnabled()

Sets if analytics is should be enabled or disabled for the current browser. Analytics are by default enabled, and may be disabled either by calling this method or passing disableAnalytics: true in the SDK configuration.

Example
await sdk.analytics.setEnabled(false) // disable analytics
await sdk.analytics.setEnabled(true) // enable analytics

Type Definitions

ChannelRegistrationResult

Result of a channel registration.

Properties:
Name Type Description
channelId string

The channel id

Type:
  • object

ConflictEvent

An event representing known data about a contact, emit in the event of a conflict which the implementer must handle in their business logic.

Properties:
Name Type Attributes Description
namedUserId string <optional>

The named user id, if one was set.

attributes Array

Known attribute mutations.

tags TagMutationsPayload

Known tag mutations.

associatedChannels Array

Known associated channels.

subscriptions Array

Known subscription list mutations.

Type:
  • object

DisplayOptions

Common Display options for subscription forms

Properties:
Name Type Attributes Description
size FormSize <optional>

Form size; one of "small", "large"

i18n Translations <optional>

Internationalization strings

defaultTranslation string <optional>

Default translation which will be loaded if one is not available for the, customer's browser.

Type:
  • object

FormOptionsBase

Common form options which are shared by all form types.

Properties:
Name Type Attributes Description
platform Platform

The platform; one of "sms" or "email"

onRegister RegistrationEventHandler <optional>

Event handler called when registration occurs.

Type:
  • object

IconDisplay

Preference center display information.

Properties:
Name Type Attributes Description
name string
description string <optional>
icon string <optional>

the url of the icon

Type:
  • object

ModalEvents

Fired when the modal is opened

Properties:
Name Type Description
open CustomEvent
close CustomEvent
_interaction CustomEvent
Type:
  • object

PreferenceCenter

A preference center definition.

Properties:
Name Type Attributes Description
id string

the ID of the preference center

sections Array.<(PreferenceCenter.CommonSection|PreferenceCenter.LabeledSectionBreak)>

a list of sections

display PreferenceCenter.CommonDisplay <optional>

display information

options PreferenceCenter.Options <optional>

preference center options

id string
sections Array
display CommonDisplay <optional>
options Options <optional>
Type:
  • object

Scope

Type:
  • 'app' | 'web' | 'email' | 'sms'

SubscriptionPluginModalOptions

Options for instantiating a modal subscription form.

Properties:
Name Type Attributes Description
automatic SubscriptionPluginModalTiming <optional>
dismissAfterSubmitDelay number <optional>
Type:
  • object

Translation

Form translation.

Properties:
Name Type Attributes Description
terms string

Terms that the customer will agree to in registering for a particular, channel. May be HTML, and should include a link to terms and conditions.

heading string <optional>

An optional heading that will be displayed at the top of the form.

footer string <optional>

An optional footer that will be displayed at the bottom of the form.

bannerUrl string <optional>

An optional URL to a banner image which will be displayed on the form.

submitButton string

Text displayed on the submit button. If not provided a default is used.

successHeading string

Text displayed after a successful registration; if not provided a default, is used.

successMessage string

Additional instructional text, displayed as a paragraph after the success, heading. If not provided it will be omitted from the display rather than, replaced by a default.

placeholderEmail string

Placeholder email address that will be displayed in the email form; if not, provided a default is used.

placeholderMsisdn string

Placeholder MSISDN that will be displayed in the SMS form; if not provided, a default is used.

invalidEmail string

An error message displayed when an invalid email is provided in the email, form; if not provided a default is used.

invalidMsisdn string

An error message displayed when an invalid MSISDN is provided in the SMS, form; if not provided a default is used.

genericError string

A generic error message displayed when registration fails for an unknown, reason; if not provided a default is used.

Type:
  • object

Translations

Form translations, a key/value object of locale identifier (e.g. "en") to a {Translation}.

Properties:
Name Type Description
locale: Translation

string

Type:
  • object