Feature launch: JavaScript SDK v3 delivers better performance and more control
Version three of our high-performance JavaScript SDK is now available. We’ve made major enhancements to the SDK before, which drove significant performance improvements, but this version represents a more comprehensive update. Not only have we improved performance – reducing the size by nearly 30% – we’ve added features to give you even more value and control.
We rebuilt the SDK from the ground up to be faster, smaller, and more flexible. JavaScript SDK v3 delivers better performance, gives you enhanced control, enables cookieless tracking, and features a new plugin architecture (more on this below). Now it’s even easier to overcome data collection challenges to provide every team with the data they need while ensuring compliance and maintaining fast page load speeds.
Modular foundation
The fundamental advancement of the new SDK is its modular plugin architecture. This new approach allows the SDK to load specific features on demand. It reduces bundle size by enabling only the capabilities you need while giving you access to an array of additional helpful features. A few highlights include:
- Queueing - Persist and batch events before sending
- Consent - Integrate consent platforms like OneTrust
- Bug reporting - Send errors to Bugsnag
- External IDs - Migrate anonymous IDs from other tools
See the complete plugin list in our docs.
Faster performance and more control
The latest version of our JavaScript SDK ups the ante for performance again. We reduced the size by about 25KB, a 30% reduction from the previous version, for faster page loads. Because it employs a modular architecture, loading only the required features on demand, it’s able to eliminate bloat and deliver peak performance based on your configuration. The SDK also automatically loads the optimal bundle based on browser capabilities – either the legacy bundle, built for ES5, or the modern bundle, built for ES6.
Additionally, this update gives you more control over your data collection. You can now easily configure data plane queues for your events, send batches of events, and control retries. The modular plugin architecture gives you full command over which features you want to load, and with Cookieless tracking, you can set cookieless tracking policies in your warehouse.
Cookieless tracking
You can now set your information storage preferences while loading the JavaScript SDK v3. Cookieless tracking allows you to configure whether to store customer data (anonymous IDs, user IDs) in cookies, local storage, memory, or not at all – all from your warehouse settings. This enables fully cookieless tracking compliant with regulations like GDPR.
Other improvements
In addition to the highlights covered above, JavaScript SDK v3 features a few other notable improvements and conveniences:
- It’s written in TypeScript for improved robustness
- It features built-in configuration for storage-related encryption and data migration
- Upgrading is easy – it’s a drop-in replacement for v2 via CDN (recommended) or NPM
- It dispatches events for orchestration with other JS frameworks and libraries
- It’s backward compatible with previous standard implementation
Getting started
Upgrading to the latest version of our JavaScript SDK to take advantage of its new features and get even better performance is easy. Log in to RudderStack, navigate to Sources > Javascript > Setup, and copy the new snippet (example below). Then add the snippet to your website or app to begin tracking events with the new SDK.
Please refer to the JS SDK v3 documentation to upgrade today. We welcome your feedback and feature requests! If you’re not a RudderStack user and would like to learn more about data collection with RudderStack, schedule a demo with our team today.