Skip to content

feat(plugin-web-vitals-browser): add "flush" method - #1870

Draft
daniel-graham-amplitude wants to merge 1 commit into
SDK-45-babel-plugin-rnfrom
SDK-102-web-vitals-flush
Draft

feat(plugin-web-vitals-browser): add "flush" method#1870
daniel-graham-amplitude wants to merge 1 commit into
SDK-45-babel-plugin-rnfrom
SDK-102-web-vitals-flush

Conversation

@daniel-graham-amplitude

@daniel-graham-amplitude daniel-graham-amplitude commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?:

Note

Low Risk
Small additive analytics API with shared flush logic; no auth or data-model changes, and default autocapture behavior is unchanged unless callers invoke flush manually.

Overview
Adds a flushWebVitals hook on the web vitals enrichment plugin so integrators can send the accumulated Web Vitals payload on demand, not only when the page becomes hidden.

After setup, flushWebVitals tracks the same WEB_VITALS_EVENT_NAME event the visibility listener used; that path now delegates to flushWebVitals?.() instead of calling amplitude.track inline. The plugin return type is WebVitalsPlugin, with flushWebVitals exposed via a getter and undefined until setup runs (when document is missing, flush stays unavailable).

Reviewed by Cursor Bugbot for commit 28b28a7. Bugbot is set up for automated code reviews on this repo. Configure here.

@linear-code

linear-code Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

SDK-102

@daniel-graham-amplitude
daniel-graham-amplitude marked this pull request as draft July 6, 2026 18:33
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.

1 participant