Utilities for helping your app interact with the Domo environment.

Basic Usage

import { DomoClient } from @domoinc/toolkit;

// call client static methods
domo.getUserId();

Hierarchy

  • DomoClient

Constructors

Properties

env: DomoEnv = ...

Methods

  • Returns string

  • Returns undefined | string

  • Returns undefined | string

  • Returns undefined | string

  • Returns string

  • Returns Filters[]

  • Returns undefined | string

  • Returns undefined | string

  • Returns undefined | string

  • Returns undefined | string

  • Parameters

    • origin: string

    Returns boolean

  • Domo Apps have sandbox restrictions preventing the app from opening a new browser tab when following links. As such, standard links will not work as expected inside Domo Apps.

    <a href="www.google.com" target="_blank">Will Not Work</a>
    

    If you're wanting to control the main browser you'll need to use this navigate function.

    Basic Usage

    <button onclick="openTab('www.google.com')">Open a new Window</button>
    <button onclick="useCurrentTab('www.google.com')">Use Current Window</button>

    <script>
    function openTab(url) {
    domo.navigate(url);
    }

    function useCurrentTab(url) {
    domo.navigate(url, false);
    }
    </script>

    Parameters

    • url: string
    • isNewWindow: boolean = true

    Returns void

  • Domo Apps behave like standard cards in the fact that they'll automatically reload each time the underlying datasets are updated. Depending on the app, this could have a negative impact on the user experience of your app.

    This function allows you to listen for the data update events and control how your app behaves when the dataSets are updated.

    Basic Usage

    import { DomoClient as domo } from @domoinc/toolkit;
    import Query from @domoinc/query;

    domo.onDataUpdate((alias) => {
    console.info(`${alias} just updated`, new Date().getTime());

    // now get the latest data and handle as you'd like
    (new Query()).get(alias).then((data) => {

    // do something with the data
    console.table(data); *
    });
    });

    Parameters

    • cb: Function

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • cb: Function

    Returns void

  • Parameters

    • cb: Function

    Returns ((event: MessageEvent<any>) => void)

      • (event: MessageEvent<any>): void
      • Parameters

        • event: MessageEvent<any>

        Returns void

  • Parameters

    • filters: Filters[]

    Returns void

Generated using TypeDoc