Configuration object for how the iframe will be configured
baseUrl
Optional
Type
string
Description
If you are a customer with EU Data Residency, set this to https://embed.eu.oneschema.co.
OneSchemaImporter Class
The OneSchemaImporter class is used to integrate OneSchema into your application. It inherits from an EventEmitter class. Events will be emitted based on what happens in OneSchema.
The configuration for OneSchema to be used for importing data
close(clean = false)
The close function will hide the OneSchema iframe from view.
clean
Optional
Type
boolean
Description
If true, it will remove and clean up all listeners and remove the iframe from DOM. By default, false
success Event
The success event will fire when the import is complete. The parameter to the callback will include the data that has been imported. The format of the data will be the same as the schema of webhook payload row data.
cancel Event
The cancel event will fire when the import is cancelled.
error Event
The error event will fire when an error occurs during the import. The parameter to the callback will be a message about the error.
IframeConfig
className
Optional
Type
string
Description
CSS class which will be set on the iframe. Defaults to: oneschema-iframe
parentId
Optional
Type
string
Description
HTML Id tag for an element the iframe should be appended to. By default, appends to document.body
devMode
Optional
Type
boolean
Description
Whether OneSchema should be in developer mode. Defaults to reading process.env.NODE_ENV and will be false if NODE_ENV is production, otherwise true.
autoClose
Optional
Type
boolean
Description
Whether the iframe should automatically hide when completion events are emitted. Defaults to true.
The key for the template that should be used in the import. See Creating and Editing Templates for more information about templates
webhookKey
Optional
Type
string
Description
The key for the webhook that data should be sent to after import. See Importer Webhook for more information about webhooks
blockImportIfErrors
Optional
Type
string
Description
Whether imports should be blocked if there are any errors in the sheet. Defaults to true
devMode
Optional
Type
string
Description
Whether the importer should be in devMode. This will show more helpful information to developers, but should be turned off when you deploy. Defaults to process.env.NODE_ENV !== 'production'
className
Optional
Type
string
Description
The CSS class of the iframe. Defaults to: oneschema-iframe
parentId
Optional
Type
string
Description
The id of an HTML element the iframe should be appended to. By default appends to document.body
baseUrl
Optional
Type
string
Description
If you are a customer with EU Data Residency, set this to https://embed.eu.oneschema.co.
onSuccess
Optional
Type
Function ((data) => void)
Description
This callback is called when the import is completed successfully. It will send data in the format of schema of webhook payload row data as a parameter.
onError
Optional
Type
Function ((message) => void)
Description
This callback is called when an error occurs during the import. It will send a string message as a parameter
onCancel
Optional
Type
Function (() => void)
Description
This callback is called when the user cancels the import into OneSchema.