By default, the iframe will append itself to document.body. If you would like the iframe to be included in the component tree, use the inline prop. If you need the iframe to be in a different location, use portals.
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'
customizationKey
Optional
Type
string
Description
Key for the customization that has been created in the dashboard to be used with this importer. See Multiple Customizations for more information
The CSS class of 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
style
Optional
Type
React.CSSProperties
Description
CSS styles that should be applied to the iframe
inline
Optional
Type
boolean
Description
Whether the iframe should be rendered inside the component tree. By default, false and the iframe will be placed in document.body
baseUrl
Optional
Type
string
Description
If you are a customer with multi-region hosting, set this to <https://embed.[region].oneschema.co>.
onSuccess
Optional
Type
Function ((data) => void)
Description
This callback is called when the import is completed successfully. For "local" imports will send data in the format documented here. For "webhook" imports, it will send an object with eventId and responses:
The eventId field will contain a string identifier that was included in the webhook requests. You can use this to associate the user’s session with the requests sent to your webhook. (You could also use the user JWT, which is also sent with the webhook requests, to do this.)
The responses field returns the bodies of the responses sent by your webhook endpoint. It is entirely fine to return nothing at all — you can return whatever data you’d like here. It will be array of objects with a body field containing the response, and a sequenceNumber field that indicates which request returned that response. Once this data is sent to your app you can use it however you want to guide the rest of the user’s import process.
onError
Optional
Type
Function ((OneSchemaError) => void) (version >= 0.5)
Function ((message) => void) (version < 0.5)
Description
This callback is called when an error occurs during the import.
onCancel
Optional
Type
Function (() => void)
Description
This callback is called when the user cancels the import into OneSchema.
onLaunched
Optional
Type
Function ((data) => void)
Description
This callback is called when the modal is displayed. The data will include a sessionToken field which can be used to resume the importer session. See Using a session token for more information.