Options
All
  • Public
  • Public/Protected
  • All
Menu

@thoughtspot/visual-embed-sdk

Index

Type aliases

DOMSelector

DOMSelector: string | HTMLElement

MessageCallback

MessageCallback: (payload: MessagePayload, responder?: (data: any) => void) => void

Type declaration

    • MessageCallback: Embed event message callback

      Parameters

      • payload: MessagePayload
      • Optional responder: (data: any) => void
          • (data: any): void
          • responder: Message callback function triggered when embed event initiated

            Parameters

            • data: any

            Returns void

      Returns void

MessageOptions

MessageOptions: { start?: boolean }

MessageOptions: By Providing options, getting specific event start / end based on option

group

Events

Type declaration

  • Optional start?: boolean

    A boolean value indicating that start status events of this type will be dispatched

MessagePayload

MessagePayload: { data: any; status?: string; type: string }

MessagePayload: Embed event payload: message type, data and status (start/end)

group

Events

Type declaration

  • data: any
  • Optional status?: string
  • type: string

Functions

Const getInitConfig

  • Gets the configuration embed was initialized with.

    version

    SDK: 1.19.0 | ThoughtSpot: *

    group

    Global methods

    Returns EmbedConfig

    EmbedConfig The configuration embed was initialized with.

getSessionInfo

  • getSessionInfo(): Promise<sessionInfoInterface>
  • Return a promise that resolves with the session information when authentication is successful. And info is available.

    group

    Global methods

    Returns Promise<sessionInfoInterface>

Const init

  • Initializes the Visual Embed SDK globally and perform authentication if applicable. This function needs to be called before any ThoughtSpot component like liveboard etc can be embedded. But need not wait for AuthEvent.SUCCESS to actually embed. That is handled internally.

    example
      const authStatus = init({
        thoughtSpotHost: 'https://my.thoughtspot.cloud',
        authType: AuthType.None,
      });
      authStatus.on(AuthStatus.FAILURE, (reason) => { // do something here });
    
    version

    SDK: 1.0.0 | ThoughtSpot ts7.april.cl, 7.2.1

    group

    Authentication / Init

    Parameters

    • embedConfig: EmbedConfig

      The configuration object containing ThoughtSpot host, authentication mechanism and so on.

    Returns AuthEventEmitter

    AuthEventEmitter event emitter which emits events on authentication success, failure and logout. See AuthStatus

Const logout

  • logout(doNotDisableAutoLogin?: boolean): Promise<boolean>
  • Logs out from ThoughtSpot. This also sets the autoLogin flag to false, to prevent the SDK from automatically logging in again.

    You can call the init method again to re login, if autoLogin is set to true in this second call it will be honored.

    version

    SDK: 1.10.1 | ThoughtSpot: 8.2.0.cl, 8.4.1-sw

    group

    Global methods

    Parameters

    • doNotDisableAutoLogin: boolean = false

      This flag when passed will not disable autoLogin

    Returns Promise<boolean>

    Promise which resolves when logout completes.

Const prefetch

  • Prefetches static resources from the specified URL. Web browsers can then cache the prefetched resources and serve them from the user's local disk to provide faster access to your app.

    version

    SDK: 1.4.0 | ThoughtSpot: ts7.sep.cl, 7.2.1

    group

    Global methods

    Parameters

    • Optional url: string

      The URL provided for prefetch

    • Optional prefetchFeatures: PrefetchFeatures[]

      Specify features which needs to be prefetched.

    Returns void