Options
All
  • Public
  • Public/Protected
  • All
Menu

The set of options that you can use when both creating an EmbedSDK object or using EmbedSDK.createChart.

Hierarchy

Index

Properties

Optional autoRefresh

autoRefresh: undefined | false | true

Whether the embedded object should be automatically refreshed.

Optional background

background: undefined | string

The background color to use for the embedded object.

If no background is provided, it will set a default background color based on the theme.

To control the background color using CSS and classes, set to transparent.

baseUrl

baseUrl: string

The base url for your MongoDB EmbedSDK instance.

This should look something like: https://charts.mongodb.com/charts-example-url-zdvkh

chartId

chartId: string

The id for the chart you want to embed.

This can be found in the "Embed Chart" dialog when viewing a chart on a dashboard.

Optional filter

filter: undefined | object

The filter to apply to the embedded chart.

This expects an object that contains a valid query operators. Any fields referenced in this filter are expected to be whitelisted in the "Embed Chart" dialog for each Chart you wish to filter on.

Optional getUserToken

getUserToken: undefined | (() => string | Promise<string>)

A function that returns a valid JWT that will be used to authenticate the user.

This function will be called when the embedded object is first rendered, and then successively when the SDK needs to refresh an invalid token.

See also getRealmUserToken

Optional height

height: string | number

The height of the embedded object.

If no height is provided, it will default to stretching to the height of it's container. If a value is provided without units, it will be assumed to be pixels (px).

Optional maxDataAge

maxDataAge: undefined | number

How long in seconds data is considered fresh.

By default, staleness tolerance is 1 hour.

Optional refreshInterval

refreshInterval: undefined | number

How frequently a chart should refresh once it has been embedded.

The minimum refreshInterval is 10 seconds. By default, a chart will never refresh once rendered.

deprecated

This option is deprecated. Please use the autoRefresh option with the maxDataAge option to configure how often the chart refreshes.

Optional showAttribution

showAttribution: undefined | false | true

Whether to show the MongoDB attribution logo.

By default, this is set to true

Optional theme

theme: Theme

The color scheme to apply.

If the theme is set to 'dark' and you have specified a custom background color, you should ensure that your background color has appropriate contrast.

Optional width

width: string | number

The width of the embedded object.

If no width is provided, it will default to stretching to the width of it's container. If a value is provided without units, it will be assumed to be pixels (px).

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc