Working with the API allows you to access the complete array of settings and options that Dromo provides.

The API

Dromo provides a standard REST API for working with schemas. The API provides standard CRUD operations for saved schemas. You can view the full Saved Schema API reference here.

Saved Schema Structure

Schemas have the following fields:
id
string
Schemas are automatically assigned a UUID when they are created.
name
string
required
Schemas must have a unique name within your organization.Schema names are displayed in the Dromo dashboard.
settings
Settings
required
Saved schemas accept the same settings that can be provided to the browser SDK.See Settings for more details.
fields
Field[]
required
Schemas have an array of fields which also accept the same full set of options as the browser SDK.See Field Object Reference for more details.
hooks
object
You can define any or all of the hooks that Dromo provides using the Saved Schema API.The hook function JavaScript source is passed as a string, which must evaluate to a valid JavaScript function. See the defining hooks section for examples.All hooks are optional.

Defining hooks

Hook functions are defined using strings containing JavaScript source code. The code is evaluated in the end user’s browser for standard imports, and using Node.js 18 for headless imports. All types of function declarations are accepted:
  • Anonymous function expression: function(a, b) { return a + b; }
  • Named function expression: function sum(a, b) { return a + b; }
  • Arrow function: (a, b) => { return a + b; }

Using saved schemas

Saved schemas can be used in the browser or using the Headless API. You can also use the Saved Schema API to programmatically create and manage schemas.