Skip to content

Conversation

@chakra-guy
Copy link
Collaborator

@chakra-guy chakra-guy commented Apr 25, 2025

Explanation

This PR introduces the @metamask/sdk-analytics package, a standalone analytics client for tracking usage events with batching, error handling, and OpenAPI schema validation. It lays the foundation for decoupling analytics from the relay server, by separating the client and making use of the new server as well. Integration with SDK and wallet to follow in later PRs.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@socket-security
Copy link

socket-security bot commented Apr 25, 2025

@socket-security
Copy link

socket-security bot commented Apr 25, 2025

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring alerts on:

View full report

ecp4224
ecp4224 previously approved these changes Apr 25, 2025
Copy link
Contributor

@ecp4224 ecp4224 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM with 1 question

@@ -0,0 +1,7 @@
import Analytics from './analytics';

const client = new Analytics('https://mm-sdk-analytics.api.cx.metamask.io/');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be configurable via SDK options?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, good point. At the same time this is going to be bundled inside other SDKS and only one who would benefit from having this would be ourselves, but at the same time we should be able to isolate and test anything without exposing that

@codecov
Copy link

codecov bot commented Apr 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.05%. Comparing base (7bf76cb) to head (a1fa14d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1270   +/-   ##
=======================================
  Coverage   74.05%   74.05%           
=======================================
  Files         182      182           
  Lines        4352     4352           
  Branches     1066     1066           
=======================================
  Hits         3223     3223           
  Misses       1129     1129           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@elribonazo
Copy link
Contributor

@SocketSecurity ignore-all

@sonarqubecloud
Copy link

@chakra-guy chakra-guy marked this pull request as ready for review April 30, 2025 12:22
@chakra-guy chakra-guy requested a review from a team as a code owner April 30, 2025 12:22
Copy link
Collaborator

@christopherferreira9 christopherferreira9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@christopherferreira9 christopherferreira9 merged commit 12479be into main May 2, 2025
35 checks passed
@christopherferreira9 christopherferreira9 deleted the sdk-analytics branch May 2, 2025 10:40
@christopherferreira9 christopherferreira9 changed the title Add New Analytics Client feat: Add New Analytics Client May 5, 2025
This was referenced May 5, 2025
@elribonazo elribonazo mentioned this pull request May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants