Skip to content

chore(analytics-browser): update staging video analytics - #1955

Open
daniel-graham-amplitude wants to merge 1 commit into
video-analyticsfrom
no-ticket-video-analytics-staging
Open

chore(analytics-browser): update staging video analytics#1955
daniel-graham-amplitude wants to merge 1 commit into
video-analyticsfrom
no-ticket-video-analytics-staging

Conversation

@daniel-graham-amplitude

@daniel-graham-amplitude daniel-graham-amplitude commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix video playing
  • Add "delayed events" server (staging for now)

Checklist

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

@daniel-graham-amplitude
daniel-graham-amplitude requested a review from a team as a code owner August 26, 2026 22:56
@daniel-graham-amplitude daniel-graham-amplitude changed the title update staging video analytics chore: update staging video analytics Aug 26, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Staging API key env var missing
    • Added VITE_AMPLITUDE_STAGING_API_KEY to .env.example so the documented local setup supplies the staging key that track-html-video.html now reads.

Create PR

Or push these changes by commenting:

@cursor push c7841a9bf7
Preview (c7841a9bf7)
diff --git a/.env.example b/.env.example
--- a/.env.example
+++ b/.env.example
@@ -1,4 +1,5 @@
 # Copy and paste this file to .env and fill in the values
 VITE_AMPLITUDE_API_KEY=<MY_AMPLITUDE_API_KEY>
+VITE_AMPLITUDE_STAGING_API_KEY=<MY_AMPLITUDE_STAGING_API_KEY>
 VITE_AMPLITUDE_USER_ID=<MY_AMPLITUDE_USER_ID>
 VITE_GTM_CONTAINER_ID=<MY_GTM_CONTAINER_ID>

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit 169c364. Configure here.

amplitude.setUserId(userId);
amplitude.init(import.meta.env.VITE_AMPLITUDE_API_KEY, {
delayedEventsServerUrl: `${location.origin}/2/httpapi/delayed`,
amplitude.init(import.meta.env.VITE_AMPLITUDE_STAGING_API_KEY, {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Staging API key env var missing

Medium Severity

amplitude.init now reads VITE_AMPLITUDE_STAGING_API_KEY, which is not defined in .env.example or anywhere else in the repo. Vite substitutes undefined, so the SDK initializes with an empty API key and staging video events are dropped.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 169c364. Configure here.

@daniel-graham-amplitude daniel-graham-amplitude changed the title chore: update staging video analytics chore(analytics-browser): update staging video analytics Aug 26, 2026
@github-actions

Copy link
Copy Markdown

size-limit report 📦

Path Size
packages/analytics-browser/lib/scripts/amplitude-min.js.gz 63.35 KB (0%)
packages/session-replay-browser/lib/scripts/session-replay-browser-min.js.gz 135 KB (0%)
packages/unified/lib/scripts/amplitude-min.umd.js.gz 216.25 KB (0%)
@amplitude/element-selector (gzipped esm) 2.67 KB (0%)

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