Basic Workflow

flowchart TD
    A(["šŸš€ Start: App Launches SDK"]) --> A1[app calls initialize]
    A1 --> A2[SDK emits getUser]
    A2 --> A3[app call setUser]
    A3 --> A4[sdk emits getDeviceName]
    A4 --> A5[app calls setDeviceName]
   
    A5 --> ActivationFlow

    subgraph ActivationFlow [Activation Flow]

        H["šŸ”¢SDK emits getActivationCode/getEmailOtp/getSmsOtp"]
        H --> J["āœļø App collects OTP and calls setActivationCode/setEmailOtp/setSmsOtp"]
        J --> M{"ā“ Are secret questions configured?"}
        M -- "āœ… Yes" --> N["🧠 SDK emits onSelectSecretQuestionAnswer"]
        N --> O["šŸ—£ļø App shows questions, collects answer, calls setSecretQuestionAnswer"]
        M -- "āŒ No" --> P["ā­ļø Skip secret questions"]
        O --> Q["šŸ”’ SDK emits getUserConsentForLDA"]
        P --> Q
        Q --> R["āœ… User provides LDA consent; app calls setUserConsentForLDA"]
        R --> |consent = true| S[SDK initiates LDA authentication]
        R --> |consent = false| S1[šŸ”¢sdk emits getPassword]
        S1 --> S2[āœļøapp calls setPassword to set up password]
        S -->|devide does not support LDA| S1
        S -->|LDA auth successful| W["šŸŽ‰ Activation completed"]
    end
    W --> W1[sdk calls getDeviceToken]
    W1 --> X[app calls setDeviceToken]
    X --> Y[sdk emits onUserLoggedIn]
    S --> |LDA auth fails| S1
    S2 --> W