Aller au contenu principal

Credential states

Credentials go through various states during their lifecycle. Understanding these states is crucial for providing appropriate UI feedback to your users.

Each credential object has a state field:

...
state: {
index: 3, // Number from -2 to 7
max: 7, // Always 7
title: "2FA code is required", // Title of the current state
message: "A 2FA code has been sent to ***@gmail.com" // Instructions for the current state
},
...
StateIndexDescriptionPossible actions
Unknown0Something went wrong - Unexpected state
Preparing collect1Initial preparation phase before collection starts
Authentication in progress2Authentication process is underway
2FA code required3Two-factor authentication code is needed from user
Performing 2FA4Processing the provided 2FA code
Collecting data5Gathering data from the collector source
Downloading invoices6Retrieving invoice files
Done7Collection completed successfully
Error-1An error occurred during the process
Disconnect-2Credential needs to be reconnected

State Flow Diagram

state_diagram