Skip to content

Module bundling and session recording updates

Compare
Choose a tag to compare
@jakewski jakewski released this 23 Jul 23:10
· 89 commits to master since this release

The SDK is now provided in several new builds with different options around included modules and asynchronous loading:

  1. Core mixpanel build with bundled mixpanel-recorder session-recording module (default):
import mixpanel from 'mixpanel-browser';
  1. Core mixpanel build that optionally loads mixpanel-recorder asynchronously via script tag (previous default):
import mixpanel from 'mixpanel-browser/src/loaders/loader-module-with-async-recorder';
  1. Core mixpanel build only (no session recording available):
import mixpanel from 'mixpanel-browser/src/loaders/loader-module-core';

This release also includes updates and improvements to the session recording module:

  • Improved reliability via integration with the main SDK's network batching/retry system
  • Inactivity timeouts are now determined by user interaction events
  • New configuration options enable inlining of images and fonts into recording payloads:
mixpanel.init(`my token`, {
  record_sessions_percent: 5,
  record_collect_fonts: true,
  record_inline_images: true,
});

NOTE: with image-inlining turned on, image-intensive pages may increase payload size significantly and possibly surpass the API server's request size limit.