The Shopify Hydrogen setup is largely the same as the React integration guide, except it goes further into how to add to the framework's app root component.
Install
Configure
The <Partytown/> component is imported from the @qwik.dev/partytown/react submodule. The config properties are JSX props.
The following is an example of including the <Partytown/> component in a root Shopify component. Notice the <Partytown/> component before the <DefaultSeo/> component.
Add the type="text/partytown"prop for each script that should run from a web worker. The example below is using the React specific way of inlining a script with dangerouslySetInnerHTML.
Copy Library Files
Copy library files to public/~partytown. How the files are copied or served from your site is up to each site's setup. A partytown copylib CLI copy task has been provided for convenience which helps copy the Partytown library files to the public directory. Below is an example of creating a "partytown" NPM script which could run before the build: