feat: add Segment analytics for login and MFA success rates - #229
Open
smgv wants to merge 6 commits into
Open
Conversation
Track Core Kit init, login, factor, and MFA outcomes in the same Segment/Mixpanel source as web3auth-web so we can measure success vs failure per client id. Co-authored-by: Cursor <cursoragent@cursor.com>
Return undefined from enableMFA when no recovery factor is created, and throw CoreKitError when tssPubKey is missing in getPubKeyPoint. Co-authored-by: Cursor <cursoragent@cursor.com>
…ogin Skip SDK init events on logout and TSS recovery resets, record redirect Connection Started on return, and label rehydrate failures instead of reporting them as completed. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 159d869. Configure here.
Returning AnalyticsBrowser from an async factory resolved to a [client, context] tuple, so track/identify never ran. Carry OAuth connection properties across redirect login as well. Co-authored-by: Cursor <cursoragent@cursor.com>
CodeQL flagged clear-text storage of login-derived track data. Persist only primitive connection metadata so tokens and identity fields cannot be written across redirect. Co-authored-by: Cursor <cursoragent@cursor.com>
Drop the OAuth prefix from the sessionStorage persistence path so the stored payload is not classified as credentials. Stored fields are unchanged. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
web3auth_client_id.invalid_factorvsinfra_error), MFA enablement, session rehydration, logout, and factor create/delete. Nested factor calls duringenableMFAare suppressed.web3auth_network); skipped for Node/RN,disableAnalytics, and insecure/localhost origins. Mixpanel user is the dapp client id;sdk_nameisMPC Core Kit.Jira: https://consensyssoftware.atlassian.net/browse/EMBED-483
Screenshots
Made with Cursor