Partytown
Relocate resource intensive third-party scripts off of the main thread
by QwikDevFree
Domain Rating
by Ahrefs
Domain Rating by Ahrefs76
Description
Partytown is a lazy-loaded library that moves resource-intensive third-party scripts off the main browser thread and into a web worker. Third-party scripts are code embedded in your site that you do not control, such as analytics, metrics, ads, A/B testing and trackers, and they often slow pages down. Partytown keeps the main thread for your own code and runs those scripts in a worker. It sandboxes third-party scripts and lets you allow or deny their access to main-thread APIs, batches DOM reads and writes to reduce layout thrashing, and throttles scripts' access to the main thread. Scripts are meant to run as written, and the library handles the synchronous DOM operations they expect. It has integrations for frameworks including Next.js, Nuxt, Qwik, React, Remix, Astro, Angular and SvelteKit, and for Google Tag Manager and the Facebook Pixel. The project is maintained by QwikDev. Its FAQ and trade-offs pages note that it may not work with every script, so the docs recommend testing in development before production.…
Highlights
- Runs third-party scripts in a web worker
- Keeps the main thread for your own code
- Sandboxing with control over main-thread API access
- Integrations for Next.js, Nuxt, React and more
- Works with Google Tag Manager and Facebook Pixel
Ratings & Reviews
No ratings yet
Be the first to rate Partytown.
People also visit
Analytics
Lightweight analytics abstraction layer for tracking page views, custom events
Partytown FAQ
What is Partytown?
A library that runs third-party scripts, such as analytics and ads, in a web worker so they stop competing with your site's code on the main thread.
Will every script work with Partytown?
Not necessarily. The FAQ says some scripts may hit an internal error and fail silently, so test them in development and then in production.
Which frameworks does it support?
Integrations are listed for Angular, Astro, Drupal, Gatsby, HTML, Magento 2, Next.js, Nuxt, Qwik, React, Remix, Shopify Hydrogen, Shopify OS 2.0, Solid, SvelteKit, TanStack Start and WordPress.
Can it run Google Tag Manager?
Yes. The docs include a page for Google Tag Manager and one for the Facebook Pixel as common third-party services.
What does it change for my scripts?
Scripts are meant to run as they are coded. Partytown sandboxes them and sets rules for their access to the main thread.
Where do I get help?
The project links a Discord server and a GitHub repository for questions and issues.
What are the best Partytown alternatives?
Popular alternatives to Partytown include Analytics, 🎈 PartyKit Docs and Save Analytics From Content Blockers. See all Partytown alternatives






