EmbedOptions

The EmbedOptions object contains details for what content items should be embedded and any filter information required.
Constructors
embedOptions{
contentId:string,
filters?: Filter,
targets?:Target[],
theme?:string,
appStyles?:AppStyle,
onLoad?: function (content:EmbeddedResult),
deviceType?: string,
slideNumber?: number,
locale?:string,
exporting?:exportTypes[],
fullDiscovery?:boolean,
contentTheme?:string
}: EmbedOptions
contentId:string,
filters?: Filter,
targets?:Target[],
theme?:string,
appStyles?:AppStyle,
onLoad?: function (content:EmbeddedResult),
deviceType?: string,
slideNumber?: number,
locale?:string,
exporting?:exportTypes[],
fullDiscovery?:boolean,
contentTheme?:string
}: EmbedOptions
Use this to set the details for embedding:
- The content ID is the GUID string of the item that is to be embedded. Required.
- Filters is the Filter object of items to drive filtering on the content. Optional.
- Targets is the Target object of items to drive targeted filtering on the content. Optional.
- Theme is a string to drive the basic colors of the embedded application. This general package of settings can be overwritten or customized with the detailed AppStyles settings (see below) . Optional. Choices are:
- "dark"
- "light" (default)
- AppStyles is the optional AppStyle object of settings to highly customize the embedded client application's appearance. It does NOT change the look a feel of analytic content. This is handled by the contentTheme property below. It is used to customize the basic application "Theme" chosen above.
- The onLoad event function is a callback function that will be triggered once the content has been loaded and there is a result. Optional.
- The optional device type specifies the layout type of the presentation to use. If not supplied, the device type is determined automatically. Types are:
- "desktop"
- "tablet"
- "phone"
- The optional slide number value is used to launch a dashboard / present content item straight to a specific slide number.
- The locale string can be used to change the localization of the embed client's UI to one of the supported application languages. Note this is only relevant with anonymous embedding.
- Export types can be used to control which export / print options are available to the user.
- The optional fullDiscovery boolean value indicates whether slicers should be visible when embedding Discover content.
- ContentTheme is a string of the ID for a design theme that should be used to stylize the content itself. It's optional, and the original content theme will be used if it is not supplied.
Content Themes
The listing of content themes can be extracted using the Theme APIs.
Example
The following instantiates a new filter object and attaches a filter for the year 2020 from the dates dimension. This is then attached to the an EmbedOptions object called options, which is then added to the embed method call.
When the content has loaded up, the ContentLoaded function will be called and passed the EmbeddResult object. Any dialogs also appear with the dark theme.