mixpanel-browser 2.75.0 → 2.77.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/.claude/settings.local.json +14 -0
  2. package/.github/dependabot.yml +8 -0
  3. package/.github/workflows/integration-tests.yml +4 -4
  4. package/.github/workflows/unit-tests.yml +4 -4
  5. package/CHANGELOG.md +14 -0
  6. package/build.sh +10 -8
  7. package/dist/async-modules/mixpanel-recorder-DLKbUIEE.js +23669 -0
  8. package/dist/async-modules/mixpanel-recorder-wIWnMDLA.min.js +2 -0
  9. package/dist/async-modules/mixpanel-recorder-wIWnMDLA.min.js.map +1 -0
  10. package/dist/async-modules/mixpanel-targeting-CTcftSJC.min.js +2 -0
  11. package/dist/async-modules/mixpanel-targeting-CTcftSJC.min.js.map +1 -0
  12. package/dist/async-modules/mixpanel-targeting-CmVvUyFM.js +2520 -0
  13. package/dist/mixpanel-core.cjs.d.ts +70 -1
  14. package/dist/mixpanel-core.cjs.js +724 -426
  15. package/dist/mixpanel-recorder.js +791 -41
  16. package/dist/mixpanel-recorder.min.js +1 -1
  17. package/dist/mixpanel-recorder.min.js.map +1 -1
  18. package/dist/mixpanel-targeting.js +6 -62
  19. package/dist/mixpanel-targeting.min.js +1 -1
  20. package/dist/mixpanel-targeting.min.js.map +1 -1
  21. package/dist/mixpanel-with-async-modules.cjs.d.ts +70 -1
  22. package/dist/mixpanel-with-async-modules.cjs.js +724 -426
  23. package/dist/mixpanel-with-async-recorder.cjs.d.ts +70 -1
  24. package/dist/mixpanel-with-async-recorder.cjs.js +724 -426
  25. package/dist/mixpanel-with-recorder.d.ts +70 -1
  26. package/dist/mixpanel-with-recorder.js +1471 -450
  27. package/dist/mixpanel-with-recorder.min.d.ts +70 -1
  28. package/dist/mixpanel-with-recorder.min.js +1 -1
  29. package/dist/mixpanel.amd.d.ts +70 -1
  30. package/dist/mixpanel.amd.js +1473 -504
  31. package/dist/mixpanel.cjs.d.ts +70 -1
  32. package/dist/mixpanel.cjs.js +1473 -504
  33. package/dist/mixpanel.globals.js +724 -426
  34. package/dist/mixpanel.min.js +189 -182
  35. package/dist/mixpanel.module.d.ts +70 -1
  36. package/dist/mixpanel.module.js +1473 -504
  37. package/dist/mixpanel.umd.d.ts +70 -1
  38. package/dist/mixpanel.umd.js +1473 -504
  39. package/dist/rrweb-bundled.js +61 -9
  40. package/dist/rrweb-compiled.js +56 -9
  41. package/logo.svg +5 -0
  42. package/package.json +6 -4
  43. package/rollup.config.mjs +163 -46
  44. package/src/autocapture/index.js +10 -27
  45. package/src/config.js +9 -3
  46. package/src/flags/index.js +1 -2
  47. package/src/index.d.ts +70 -1
  48. package/src/mixpanel-core.js +77 -112
  49. package/src/recorder/index.js +1 -1
  50. package/src/recorder/recorder.js +5 -1
  51. package/src/recorder/rrweb-network-plugin.js +649 -0
  52. package/src/recorder/session-recording.js +36 -12
  53. package/src/recorder/utils.js +27 -1
  54. package/src/recorder-manager.js +324 -0
  55. package/src/request-batcher.js +1 -1
  56. package/src/targeting/event-matcher.js +2 -57
  57. package/src/targeting/index.js +1 -1
  58. package/src/targeting/loader.js +1 -1
  59. package/src/utils.js +13 -1
  60. package/testServer.js +69 -1
  61. package/src/globals.js +0 -14
  62. /package/src/loaders/{loader-module-with-async-recorder.d.ts → loader-module-with-async-modules.d.ts} +0 -0
@@ -0,0 +1,14 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(mkdir:*)",
5
+ "Bash(cat:*)",
6
+ "Bash(node --input-type=module -e \"import { expect } from 'chai'; console.log\\('works'\\);\":*)",
7
+ "Bash(BABEL_ENV=test node:*)",
8
+ "Bash(npm test)",
9
+ "Bash(grep -E \"\\\\.\\(js|json\\)$\")"
10
+ ],
11
+ "deny": [],
12
+ "ask": []
13
+ }
14
+ }
@@ -5,3 +5,11 @@ updates:
5
5
  directory: "/" # Tells Dependabot to scan root directory only
6
6
  schedule:
7
7
  interval: "daily"
8
+ cooldown:
9
+ default-days: 30
10
+ - package-ecosystem: "github-actions"
11
+ directory: "/"
12
+ schedule:
13
+ interval: "weekly"
14
+ cooldown:
15
+ default-days: 30
@@ -2,9 +2,9 @@ name: Integration Tests
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [master]
5
+ branches: [master, '**/*-rc']
6
6
  pull_request:
7
- branches: [master]
7
+ branches: [master, '**/*-rc']
8
8
 
9
9
  jobs:
10
10
  build:
@@ -25,9 +25,9 @@ jobs:
25
25
  SAUCE_TUNNEL_NAME: ci-js-sdk-test-${{ matrix.browser }}-${{ github.run_id }}
26
26
 
27
27
  steps:
28
- - uses: actions/checkout@v4
28
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
29
29
  - name: Use Node.js 22.x
30
- uses: actions/setup-node@v4
30
+ uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
31
31
  with:
32
32
  node-version: 22.x
33
33
 
@@ -2,9 +2,9 @@ name: Unit Tests
2
2
 
3
3
  on:
4
4
  push:
5
- branches: [master]
5
+ branches: [master, '**/*-rc']
6
6
  pull_request:
7
- branches: [master]
7
+ branches: [master, '**/*-rc']
8
8
 
9
9
  jobs:
10
10
  build:
@@ -19,9 +19,9 @@ jobs:
19
19
  node-version: [20.x, 22.x, 24.x]
20
20
 
21
21
  steps:
22
- - uses: actions/checkout@v4
22
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
23
23
  - name: Use Node.js ${{ matrix.node-version }}
24
- uses: actions/setup-node@v4
24
+ uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
25
25
  with:
26
26
  node-version: ${{ matrix.node-version }}
27
27
  - run: npm ci
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ **2.77.0** (24 Mar 2026)
2
+ - Session recording now supports cross origin iframe recording by specifying allowed domains via `record_allowed_iframe_origins`.
3
+ - Added type dependency @types/json-logic-js for the RulesLogic type introduced in 2.76.0
4
+
5
+ **2.76.0** (18 Mar 2026)
6
+ - Added a new network plugin that captures network telemetry during session recordings.
7
+ - Added recording_event_triggers configuration option that allows starting a session recording when targeted events that meet specified property filters occur. Property filters are optional and use json-logic syntax, but this option is mainly intended to be used by remote settings (closed beta). Allows session replays to start on a trigger if a session replay is not already in progress. Does not affect any active recording sessions.
8
+ - Added mixpanel.enable() public method, complementing the existing disable() method. Re-enables tracking for some or all events after disable() has been called.
9
+ - Changed async bundles (e.g., mixpanel-recorder, mixpanel-targeting) loaded via CDN or loader-module-with-async-modules entry points to use hash-based file names for consistent versioning with the main SDK (e.g. mixpanel-recorder.min.js => mixpanel-recorder-bIS4LMGd.min.js). For customers who already proxy these files individually from the CDN, we recommend proxying everything under cdn.mxpnl.com/libs/* for reliability.
10
+ - Fixed event property matching in targeting to respect case sensitivity, consistent with how Mixpanel handles property names.
11
+ - Added dependency declaration for @mixpanel/rrweb-utils, a peer dependency of @mixpanel/rrweb-plugin-console-record. This was causing errors for users with strict peer dependencies enabled.
12
+ - Fixed an error thrown when disabling recording from remote settings and AbortController is not supported in the browser.
13
+ - Stabilized Safari simulator tests and ported remote settings tests to new test infrastructure.
14
+
1
15
  **2.75.0** (24 Feb 2026)
2
16
  - Adds support for Feature Flags targeting based on events tracked during the current session (Runtime Targeting)
3
17
  - Fixes memory leaks in Session Recording on sites which create/destroy iframes
package/build.sh CHANGED
@@ -14,16 +14,18 @@ npx rollup -c rollup.config.mjs
14
14
 
15
15
  ln -sf mixpanel.globals.js build/mixpanel.js
16
16
 
17
- if [ ! -z "$FULL" ]; then
18
- echo 'Bundling module-loader test runners'
19
- npx webpack tests/module-cjs.js tests/module-cjs.bundle.js
20
- npx browserify tests/module-es2015.js -t [ babelify --compact false ] --outfile tests/module-es2015.bundle.js
21
-
22
- pushd examples/typescript; npm install && npm run build; popd
23
- fi
24
-
25
17
  if [ ! -z "$DIST" ]; then
26
18
  echo 'Copying to dist/'
27
19
  rm -r dist
28
20
  rsync -av --exclude='test' build/ dist/
21
+
22
+ # typescript examples require dist files
23
+ echo 'Building TypeScript examples'
24
+ pushd examples/typescript; npm install && npm run build; popd
25
+ fi
26
+
27
+ if [ ! -z "$FULL" ]; then
28
+ echo 'Bundling module-loader test runners'
29
+ npx webpack tests/module-cjs.js tests/module-cjs.bundle.js
30
+ npx browserify tests/module-es2015.js -t [ babelify --compact false ] --outfile tests/module-es2015.bundle.js
29
31
  fi