Overview
The Document Upload flow allows users to submit identity documents by uploading files instead of capturing them with a camera. Users progress through three upload stages — required documents, partial documents (pick at least N from a group), and optional documents — then review their uploads before submission. This flow is useful for desktop-first applications, pre-scanned documents, or when camera access is unavailable. Modules used:form (WELCOME, CONSENT, REQUIRED_DOCUMENT_UPLOAD, PARTIAL_DOCUMENT_UPLOAD, OPTIONAL_DOCUMENT_UPLOAD, REVIEW, RESULT screens)
Instead of building from scratch, fork an existing flow from the public sample codes.
Entity must already exist. The document upload flow requires the entity used in the session to already exist — created via the API, the FrankieOne Portal, or a prior SDK flow. If you need to create the entity on the fly, use the Individual module or an eKYC form flow before starting the document upload.
Flow Diagram
Partial Document Upload
User uploads at least the minimum required number from a group of documents.
Full Implementation
- Vanilla HTML/JS
- React
Step-by-Step Breakdown
1. Initialize the SDK
Pass the session object toOneSDK(). Include the form.provider and form.docUpload recipe configuration. The docUpload property defines which documents appear at each upload stage.
2. Configure the docUpload Recipe
ThedocUpload recipe controls the three upload stages:
3. Create Upload Screen Components
Create a component for each upload stage using the dedicated screen names:4. Wire Up Events
Use.on(event) listeners to navigate through the upload stages. Each stage emits a form:<screen_name>:ready event when complete.
5. Handle Results
The review screen emitsform:review:ready on success and form:review:failed on failure. Use UPLOAD_SUCCESS and UPLOAD_FAIL result states for the result screen. See Error Scenarios for details.
Upload Screen Types
The document upload flow uses three distinct screen types, each configured through thedocUpload recipe:
| Screen | Recipe Property | Behavior |
|---|---|---|
REQUIRED_DOCUMENT_UPLOAD | requestedDocuments | All listed documents must be uploaded |
PARTIAL_DOCUMENT_UPLOAD | partialDocuments | At least minimumRequirement documents must be uploaded from each group |
OPTIONAL_DOCUMENT_UPLOAD | optionalDocuments | Documents may be uploaded but are not required |
Required vs Optional Documents
Configure the three tiers in thedocUpload recipe:
Review After Upload
The review screen shows all uploaded documents for confirmation. Usetype: "doc_upload" to render the upload-specific review UI:
UPLOAD_SUCCESS and UPLOAD_FAIL result states for the outcome screens:
Customization Reference
| Aspect | Reference |
|---|---|
| SDK initialization options | SDK Initialization |
| Form screen configuration | Form Module |
| Document upload recipe | Document Upload Configuration |
| Screen names and types | Form Screens |
| Custom field configuration | Form Configuration |
| Event names and payloads | Events |
| Error handling patterns | Error Scenarios |