This repo is a demo of integrating Amplitude within a React app using web workers facilitated with Partytown 🎉
This allows loading Amplitude in a web worker and removing it from the main JS thread, which in turn allows faster initial page load times. Partytown provides fallbacks for browsers that do not support web workers.
This demo uses Vite and the Partytown Vite Plugin to simplify the file copying, but this setup can be accomplished with any bundler.