|
| 1 | +# Observe SDK Integration into Complete React SDK — STATUS |
| 2 | + |
| 3 | +All planned phases have been implemented. This document now reflects the final status. |
| 4 | + |
| 5 | +## What was implemented |
| 6 | + |
| 7 | +### Flow-level events (ProcessHandler) |
| 8 | +- [x] `loginVisible` — fires when LoginInitBlock first becomes primary |
| 9 | +- [x] `loginFinish` — fires in onProcessCompleted when authType === Login |
| 10 | +- [x] `signupVisible` — fires when SignupInitBlock first becomes primary |
| 11 | +- [x] `signupFinish` — fires in onProcessCompleted when authType === Signup |
| 12 | +- [x] `loginReset` — fires when LoginInitBlock becomes primary again (after being away) |
| 13 | + |
| 14 | +### Social login (LoginInitBlock + SignupInitBlock) |
| 15 | +- [x] `socialLoginStart` — fires before startSocialVerification API call |
| 16 | +- [x] `socialLoginFinish` — fires when finishSocialVerification succeeds |
| 17 | +- [x] `socialLoginError` — fires when finishSocialVerification fails |
| 18 | + |
| 19 | +### Identifier tracking (LoginInitBlock + SignupInitBlock + React components) |
| 20 | +- [x] `provideIdentifierStartable` — created via tracker in LoginForm.tsx / SignupInit.tsx with DOM ref |
| 21 | +- [x] `provideIdentifierSubmitted` — fires in start() / updateUserData() before API call |
| 22 | +- [x] `provideIdentifierFinished` — fires on successful API response |
| 23 | +- [x] `provideIdentifierError` — fires on failed API response |
| 24 | +- [x] Input field instrumentation (auto-detect first character, paste, CUI via PatternDetector) |
| 25 | + |
| 26 | +### Login methods decision (LoginInit + PasskeyError screens) |
| 27 | +- [x] `loginMethodsDecisionOffered` — fires in LoginInit.tsx, PasskeyError.tsx, PasskeyErrorLight.tsx |
| 28 | + |
| 29 | +### Email OTP (EmailVerifyBlock) |
| 30 | +- [x] `emailOTPStartable` — fires when block is created with verificationMethod === 'email-otp' |
| 31 | +- [x] `emailOTPSubmitted` — fires in validateCode() before API call |
| 32 | +- [x] `emailOTPFinished` — fires on successful validation |
| 33 | +- [x] `emailOTPError` — fires on failed validation |
| 34 | +- [x] `emailOTPResent` — fires on successful resend |
| 35 | + |
| 36 | +### Email Link (EmailVerifyBlock) |
| 37 | +- [x] `emailLinkStartable` — fires when block is created with verificationMethod === 'email-link' |
| 38 | +- [x] `emailLinkSubmitted` — fires in validateEmailLink() before API call |
| 39 | +- [x] `emailLinkFinished` — fires on successful link validation |
| 40 | +- [x] `emailLinkError` — fires on failed link validation |
| 41 | + |
| 42 | +### web-core changes (B1 fix) |
| 43 | +- [x] `loginWithPasskey()` — added `onCeremonyData` callback exposing assertionOptions + assertionResponse |
| 44 | +- [x] `loginWithPasskeyChallenge()` — extended `onAuthenticatorCompleted` to pass assertionOptions + assertionResponse |
| 45 | +- [x] `appendPasskey()` — added `onCeremonyData` callback exposing attestationOptions + attestationResponse |
| 46 | + |
| 47 | +### Passkey login (PasskeyVerifyBlock + LoginInitBlock conditional UI) |
| 48 | +- [x] `passkeyLoginStart` — fires via onCeremonyData callback with assertionOptions |
| 49 | +- [x] `passkey.submitted` — fires with assertionResponse |
| 50 | +- [x] `passkey.finished` — fires on successful login |
| 51 | +- [x] `passkey.clientError` / `passkey.serverErrorUnknown` — fires on failure |
| 52 | +- [x] Conditional UI tracking — `conditionalUIStartable`, `conditionalUISubmitted`, `conditionalUIFinished`, `conditionalUIClientError` in LoginInitBlock |
| 53 | + |
| 54 | +### Passkey enrollment (PasskeyAppendBlock) |
| 55 | +- [x] `passkeyEnrollmentStartable` — fires when block is initialized |
| 56 | +- [x] `passkey_enrollment.started` — fires via onCeremonyData with attestationOptions |
| 57 | +- [x] `passkey_enrollment.submitted` — fires with attestationResponse |
| 58 | +- [x] `passkey_enrollment.finished` — fires on successful append |
| 59 | +- [x] `passkey_enrollment.clientError` — fires on failure |
| 60 | +- [x] `passkey_enrollment.skipped` — fires in skipPasskeyAppend() |
| 61 | + |
| 62 | +--- |
| 63 | + |
| 64 | +## Architecture |
| 65 | + |
| 66 | +- `ObserveTracker` interface defined in `src/contexts/ObserveContext.ts` (no hard dependency on @corbado/observe) |
| 67 | +- Tracker passed via `CorbadoProvider` → `ObserveContext` → `FlowHandlerProvider` → `ProcessHandler` → Block classes |
| 68 | +- Flow-level events fire from `ProcessHandler` |
| 69 | +- Block-level events fire from Block class methods |
| 70 | +- DOM-dependent events (provideIdentifierStartable) bridge via React components setting operations on blocks |
| 71 | + |
| 72 | +## Remaining gaps (future work) |
| 73 | + |
| 74 | +| Gap | Description | |
| 75 | +|-----|-------------| |
| 76 | +| Phone OTP events | No `phoneOTP*` events in observe SDK | |
| 77 | +| Missing fields events | No tracking for the "complete your profile" step | |
| 78 | +| Phone identifier instrumentation | `provideIdentifierStartable` assumes text input | |
| 79 | +| Password events | No password login events tracked (not present in complete SDK) | |
0 commit comments