DromoUploader Instance

To begin an import, you first need to create an instance of the DromoUploader:
const dromo = new DromoUploader(licenseKey, fields, settings, user);

Constructor

The DromoUploader constructor takes 4 parameters:
licenseKey
string
required
Your Dromo front-end license key, which can be found in the Dromo dashboard.
fields
Field[]
required
An array of fields which comprise your import schema.
settings
Settings
required
Settings to change the behavior of the Dromo importer.
user
User
required
Metadata about the end user to associate with the import.

Configuration Methods

Once you have an instance, you can register callbacks and configure its behavior using the following methods. You can register callbacks for running hooks and receiving results.
registerColumnHook(fieldKey: string, callback: ColumnHookFn) => void
Used to register a column hook callback on the field with the given field key.
registerRowHook(callback: RowHookFn) => void
Used to register a standard row hook callback.
registerBulkRowHook(callback: BulkRowHookFn) => void
Used to register a bulk row hook callback.
registerStepHook(stepHookType: "UPLOAD_STEP" | "REVIEW_STEP" | "REVIEW_STEP_POST_HOOKS", callback: StepHookFn) => void
Used to register a step hook callback of the given type.
registerRowDeleteHook(callback: RowDeleteHookFn) => void
Used to register a row delete hook callback.
beforeFinish(callback: BeforeFinishCallbackFn) => void
Used to register a beforeFinish callback.
onResults(callback: OnResultsCallbackFn) => void
Used to register an onResults callback.
onCancel() => void
Called when the user exits the Dromo Uploader without completing the import.
Example of registering callbacks:
dromo.registerColumnHook('zipCode', (colData) => {  
  return colData.map((zipCode) => {
    return { ...zipCode, value: zipCode.value.padStart(5, '0') };  
  });
});
dromo.onResults((data, metadata) => {  
  console.log(data);
});

Starting the Import

With Dromo fully configured, call open() on the uploader instance to start the import process.
open() => void
Opens the Dromo Uploader interface to begin the import process.
dromo.open();