Embed Data Wizard into your web application using iFrames and interact with it programmatically using the JavaScript API.
src
attribute contains the pre-signed URL, which is unique for each Extractor and includes a security signature.
width
, height
, style
, class
, etc. You can also customize the UI further using CSS by setting the DATA_WIZARD_CSS_URL
environment variable in Data Wizard to point to your custom CSS file.
window.addEventListener('message', ...)
in your host application to listen for messages from the iFrame.
Example JavaScript Code to Receive iFrame Events:
screen.changed
: User navigated to a different screen in the embedded extractor.extraction.started
: Extraction process has begun.extraction.progress
: Real-time updates during extraction (data chunks as they are extracted).extraction.completed
: Extraction finished successfully. message.data.data
contains the final extracted data in JSON format.extraction.error
: An error occurred during extraction. message.data.error
contains error details.extraction.submitted
: User has submitted the final data after manual correction. message.data.data
contains the final (potentially corrected) data.?theme=light
or ?theme=dark
to the iFrame src
URL to set the initial theme.set_theme
Message: Send a set_theme
message to the iFrame using wizardFrame.postMessage({ event: 'set_theme', theme: 'dark' }, '*')
to dynamically change the theme while the iFrame is open.DATA_WIZARD_CSS_URL
, ensure the CSS file is hosted securely and only contains safe CSS rules to prevent potential security risks.