A powerful JavaScript SDK for building custom applications within the Domo platform
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
CDN / Script Tag
Load the library directly from a CDN. The bundle exposes a globaldomo object:
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
MessageChanneland transfersport2to the parent on subscribe. The parent sends filter updates, variable changes throughport2; your app receives them onport1. window.parent.postMessage(outbound) — Outbound messages (filter requests, navigate, app data) always usewindow.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:
Token Injection
A singleMutationObserver 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 useXMLHttpRequest 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 URLoptions(object, optional) — Request options
Promise<ResponseBody>
Basic Usage:
'array-of-objects'(default) —ObjectResponseBody[]'array-of-arrays'—ArrayResponseBodywith.columnsand.rows'csv'— CSV string'excel'— Blob'plain'— plain text string
domo.getAll(urls, options?)
Fetch multiple endpoints in parallel and return results as an array.
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
function — Unsubscribe function
domo.onFiltersUpdate(callback)
Listen for page-level filter changes.
Parameters:
callback—(filters: Filter[]) => void
function — Unsubscribe function
"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
"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
function — Unsubscribe function
"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
function — Unsubscribe function
Emitters
domo.filterContainer(filters, pageStateUpdate?)
Push filter changes to the parent Domo page.
Parameters:
filters(Filter[] | null, required) — Filters to apply. Passnullto clear all filters.pageStateUpdate(boolean | null, optional) — Whenfalse, only the card-level filter state is updated (default:null)
column, operator, values, and dataType.
domo.sendVariables(variables)
Send variable updates to the parent Domo page.
Parameters:
variables(Variable[]) — Array of variable objects
domo.sendAppData(data)
Send custom data to other apps on the same Domo page.
Parameters:
data(any) — Custom data object
Navigation
domo.navigate(url, isNewWindow?)
Navigate the parent Domo page from inside your app iframe.
Parameters:
url(string, required) — Domo page URL or routeisNewWindow(boolean, optional) — Open in new tab (default:false)
- 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.
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 useswebkit.messageHandlers for native communication:
Android Integration
On Android, domo.js uses global objects injected by the native app:Platform Detection
- 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 genericError objects. Use try/catch with async/await:
statusText. Check the message string to identify specific HTTP errors:
Complete Example
A real-world Custom App using the v4 API:Getting Help
- GitHub Issues — github.com/DomoApps/domo.js/issues: report bugs or browse known issues
- Domo Community — dojo.domo.com: community forums and answers
- Related docs — Domo Apps CLI | manifest.json reference | App Framework overview