Skip to main content
Version: v4 | v5 | v6 (latest)
A powerful JavaScript SDK for building custom applications within the Domo platform
npm version TypeScript domo.js (published as ryuu.js) is the JavaScript SDK for building Custom Apps inside the Domo platform. Apps run inside iframes — domo.js handles authenticated HTTP requests, messaging with the parent window, and mobile WebView bridges.

Quick Start

Get started with ryuu.js in just a few lines:

Features

  • HTTP API Access — Authenticated requests to Domo datasets, datastores, and APIs
  • Real-time Events — Listen for dataset updates, filter changes, and variable updates
  • Filter Management — Get and set page-level filters programmatically
  • Variable Management — Access and update page variables
  • Custom App Data — Send custom data between apps on the same page
  • Navigation — Programmatically navigate within Domo
  • Mobile Support — iOS and Android compatibility
  • TypeScript Ready — Type definitions included
  • Zero Dependencies — Minimal bundle size with no runtime dependencies

Installation

NPM

Then import in your application:

CDN / Script Tag

Load the library directly from a CDN. The bundle exposes a global domo object:
When using the Domo CLI, domo init scaffolds a local domo.js file you can reference with <script src="domo.js"></script> instead.

TypeScript

TypeScript definitions are included automatically:

Core Concepts

Architecture

Your Custom App runs in an <iframe> inside a Domo page. domo.js establishes communication between your app and the parent Domo window using two channels:
  • MessageChannel (inbound) — The SDK creates a MessageChannel and transfers port2 to the parent on subscribe. The parent sends filter updates, variable changes through port2; your app receives them on port1.
  • window.parent.postMessage (outbound) — Outbound messages (filter requests, navigate, app data) always use window.parent.postMessage.
domo is a static class — you never call new domo(). All methods are called directly on the class:

Environment Context

domo.env provides access to the current user and page context, populated from iframe query parameters:
Security Note: Environment properties come from URL parameters and can be spoofed. Always verify with the API for secure operations:

Token Injection

A single MutationObserver watches document.documentElement with subtree: true. For every DOM node added at any depth, it automatically injects the Domo session token (ryuu_sid) into relative href and src attributes. Token is fetched once per batch — you don’t need to manage auth manually.

API Reference

HTTP Methods

All HTTP methods use XMLHttpRequest internally and return Promises. The auth header X-DOMO-Ryuu-Session is injected automatically.

domo.get(url, options?)

Fetch data from a Domo dataset or API endpoint. Parameters:
  • url (string) — API endpoint URL
  • options (object, optional) — Request options
Returns: Promise<ResponseBody> Basic Usage:
Format Options:
Supported formats:
  • 'array-of-objects' (default) — ObjectResponseBody[]
  • 'array-of-arrays'ArrayResponseBody with .columns and .rows
  • 'csv' — CSV string
  • 'excel' — Blob
  • 'plain' — plain text string
URL Query Parameters: In v4, query parameters must be appended directly to the URL string:

domo.getAll(urls, options?)

Fetch multiple endpoints in parallel and return results as an array.
With Options:

domo.post(url, body?, options?)


domo.put(url, body?, options?)


domo.delete(url, options?)


Event Listeners

All listener methods return an unsubscribe function. Call it to stop listening.

domo.onDataUpdate(callback)

Listen for dataset update events. Called when a dataset connected to your app is refreshed. Parameters:
  • callback(alias: string) => void
Returns: function — Unsubscribe function

domo.onFiltersUpdate(callback)

Listen for page-level filter changes. Parameters:
  • callback(filters: Filter[]) => void
Returns: function — Unsubscribe function
Filter object structure:
Supported operators: String operators:
  • "IN" — Value is in list
  • "NOT_IN" — Value is not in list
  • "CONTAINS" — Value contains string
  • "NOT_CONTAINS" — Value doesn’t contain string
  • "STARTS_WITH" — Value starts with string
  • "NOT_STARTS_WITH" — Value doesn’t start with string
  • "ENDS_WITH" — Value ends with string
  • "NOT_ENDS_WITH" — Value doesn’t end with string
Numeric / Date operators:
  • "EQUALS" — Equals value
  • "NOT_EQUALS" — Not equals value
  • "GREATER_THAN" — Greater than value
  • "GREAT_THAN_EQUALS_TO" — Greater than or equals value
  • "LESS_THAN" — Less than value
  • "LESS_THAN_EQUALS_TO" — Less than or equals value
  • "BETWEEN" — Between two values

domo.onVariablesUpdated(callback)

Listen for page variable changes. Parameters:
  • callback(variables: object) => void
Returns: function — Unsubscribe function
Variables object structure (v4):
Variable IDs (like "391") are defined by Domo. Inspect the variables object in your app to find the correct IDs for your page variables.

domo.onAppData(callback)

Listen for custom data sent by other apps on the same Domo page. Parameters:
  • callback(data: any) => void
Returns: function — Unsubscribe function

Emitters


domo.filterContainer(filters, pageStateUpdate?)

Push filter changes to the parent Domo page. Parameters:
  • filters (Filter[] | null, required) — Filters to apply. Pass null to clear all filters.
  • pageStateUpdate (boolean | null, optional) — When false, only the card-level filter state is updated (default: null)
Filter requirements: All filter objects must include column, operator, values, and dataType.

domo.sendVariables(variables)

Send variable updates to the parent Domo page. Parameters:
  • variables (Variable[]) — Array of variable objects
Variable object structure:

domo.sendAppData(data)

Send custom data to other apps on the same Domo page. Parameters:
  • data (any) — Custom data object

domo.navigate(url, isNewWindow?)

Navigate the parent Domo page from inside your app iframe. Parameters:
  • url (string, required) — Domo page URL or route
  • isNewWindow (boolean, optional) — Open in new tab (default: false)
Important Notes:
  • Use domo.navigate() instead of HTML links to change the page hosting the custom app
  • For mobile web platforms, routes are automatically prefixed with /m#
  • External links are restricted to whitelisted domains (configure in Admin > Network Security > Custom Apps authorized domains)

Environment

domo.env

Provides typed access to the current user, instance, and page context. Populated from iframe query parameters.

Utilities

domo.__util

Internal utilities exposed for advanced use cases.
Note: These are internal utilities and may change between versions. Use at your own risk.

TypeScript Support

TypeScript definitions are included in the package.

Importing Types

Typed Requests

Typed Filters

Custom Data Types


Mobile Platform Support

domo.js detects the platform and routes messages through the appropriate bridge automatically.

iOS Integration

On iOS, domo.js uses webkit.messageHandlers for native communication:

Android Integration

On Android, domo.js uses global objects injected by the native app:

Platform Detection

Mobile considerations:
  • Navigation routes are automatically prefixed with /m# on mobile web
  • Test on actual devices or simulators — not just browser DevTools mobile emulation
  • Optimize data fetching: mobile devices have limited memory and CPU

Error Handling

All HTTP methods return Promises. In v4, errors are thrown as generic Error objects. Use try/catch with async/await:
Checking error types: In v4, the error message comes from the XHR statusText. Check the message string to identify specific HTTP errors:

Complete Example

A real-world Custom App using the v4 API:

Getting Help