Messages
Here is a list of all parameters that are accepted in the messages object present in the Document Detector options.
Enhanced in v6.8.3: The messages configuration now uses a nested object format for better organization and readability.
The messages
object is optional. If you don't pass it, the SDK will use the default messages based on the language
parameter (the default values listed below are for the English language).
Configuration Format
The messages options use a nested object format for better organization:
messages: {
general: {
wait: "Please wait...",
errors: {
poorQuality: "Image quality is too low. Please try again.",
documentNotFound: "Document not found. Please try again.",
invalidDocument: "This document is not valid.",
generic: "Something went wrong. Please try again."
}
},
capture: {
title: "Capture your document",
errors: {
captureFailed: "Capture failed. Please try again."
}
},
upload: {
title: "Upload your document", // Note: For front/back sides, this becomes "Upload your document - Front" or "Upload your document - Back"
details: "Please select a document to upload",
button: "Upload",
success: "Document uploaded successfully!",
errors: {
generic: {
title: "Upload failed",
details: "Please try again.",
button: "Retry"
},
invalidFileFormat: {
title: "Invalid format",
details: "Please use JPG, PNG or PDF format."
},
invalidDocument: {
title: "Invalid document",
details: "This document is not valid."
}
}
}
}
General
Parameter
Type
Default Value
wait
Loading message.
Example: general: { wait: "Please wait..." }
string
"Wait..."
errors.poorQuality
Message displayed when the captured image is with poor quality.
Example: general: { errors: { poorQuality: "Quality too low..." } }
string
"The quality of the capture was not good. Make sure you are in a bright environment and try again."
errors.documentNotFound
Message displayed when the document is not found.
Example: general: { errors: { documentNotFound: "Document not found..." } }
string
"Oops, it seems that this document is not supported."
errors.invalidDocument
Message displayed when the document is not supported.
Example: "Oops, this document is not "Front of RG""
Example: general: { errors: { invalidDocument: "Invalid document..." } }
string
"Oops, this document is not "${expectedDocumentLabel}""
errors.generic
Generic error message.
Example: general: { errors: { generic: "Something went wrong..." } }
string
"Oops, something went wrong, please try again"
Capture
Parameter
Type
Default Value
title
Capture title.
Example: capture: { title: "Capture your document" }
string
The expected document label (e.g., "Front of RG")
errors.captureFailed
Message displayed when the capture fails.
Example: capture: { errors: { captureFailed: "Capture failed..." } }
string
"Oops! We had a problem processing your image."
Upload
Parameter
Type
Default Value
title
Customization of upload screen title.
Important: When capturing specific document sides (front/back), the SDK automatically appends the side suffix to your custom title (e.g., "Your Custom Title - Front" or "Your Custom Title - Back").
Example: upload: { title: "Upload document" }
string
"Attach document"
(or with side suffix: "Attach document - Front"
, "Attach document - Back"
)
details
Customization of message below the upload screen title.
Example: upload: { details: "Select a document..." }
string
"Please allow access to your photos and attach your document"
button
Customization of the upload button text.
Example: upload: { button: "Upload" }
string
"Select file"
success
Customization of title displayed on the screen when the file was sent successfully.
Example: upload: { success: "Success!" }
string
"Photo sent successfully!"
errors.generic.title
Customization of title displayed on the screen when a generic error occurred in the upload process.
Example: upload: { errors: { generic: { title: "Error" } } }
string
"Error sending file"
errors.generic.details
Customization of message below the title displayed on the screen when a generic error occurred in the upload process.
Example: upload: { errors: { generic: { details: "Try again..." } } }
string
"Oops, something went wrong when sending your file. Please try again."
errors.generic.button
Customization of button text to perform the upload again.
Example: upload: { errors: { generic: { button: "Retry" } } }
string
"Try again"
errors.invalidFileFormat.title
Customization of title displayed on the screen when an error occurred in the format of the sent file.
Example: upload: { errors: { invalidFileFormat: { title: "Invalid format" } } }
string
"Invalid format"
errors.invalidFileFormat.details
Customization of message below the title displayed on the screen when an error occurred in the format of the sent file.
Example: upload: { errors: { invalidFileFormat: { details: "Use JPG, PNG or PDF" } } }
string
"It looks like your photo format is not supported. Try resending using JPG, PNG or PDF formats."
errors.invalidDocument.title
Customization of title displayed on the screen when an invalid document is sent.
Example: upload: { errors: { invalidDocument: { title: "Invalid document" } } }
string
"Invalid document"
errors.invalidDocument.details
Customization of message below the title displayed on the screen when an invalid document is sent.
Example: upload: { errors: { invalidDocument: { details: "Document not valid..." } } }
string
"Oops, this document is not ..."
Last updated