Skip to main content
Below is a comprehensive list of JavaScript libraries available for use in Code Engine.
LibraryDescription
codeengineInterfaces with the Code Engine system to manage workflows and data processes.
axiosA promise-based HTTP client for making external API requests.
googleAuthLibraryHandles Google authentication and authorization flows.

Functions in the codeengine library

FunctionDescription
getPersonDetailsRetrieves detailed information about a person from your system.
getAccountFetches account-related data, including access tokens and account settings.
getExecutionDetailsProvides details about workflow execution.
sendRequestSends HTTP requests for interacting with internal Domo APIs.

sendRequest

This function will send an authenticated API request to any of Domo’s product APIs.

Parameters

Property NameTypeRequiredDescription
methodStringRequiredThe HTTP method - can be ‘GET’, ‘POST’, ‘PUT’, or ‘DELETE’
urlStringRequiredThe request url
bodyObjectOptionalThe request body
headersObjectOptionalThe request headers
contentTypeObjectOptionalThe request contentType (‘application/json’ by default)

Code Example

const codeengine = require('codeengine');

async function handleRequest(
  method,
  url,
  body = null,
  headers = null,
  contentType = null,
) {
  try {
    return await codeengine.sendRequest(
      method,
      url,
      body,
      headers,
      contentType,
    );
  } catch (error) {
    console.error(`Error with ${method} request to ${url}:`, error);
    throw error;
  }
}