Module bundling and session recording updates
The SDK is now provided in several new builds with different options around included modules and asynchronous loading:
- Core mixpanel build with bundled
mixpanel-recorder
session-recording module (default):
import mixpanel from 'mixpanel-browser';
- 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';
- 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.