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