Vue with Vite
Add the tag to the<head> of your index.html, before your app’s script:
index.html
-
No hydration wait. A client-rendered Vue app has no server HTML to hydrate, so leave out
data-await-hydration. -
Routing: Vue Router’s
createWebHistoryis tracked automatically. WithcreateWebHashHistory, send anavigatecommand after each route change:
Nuxt
Add the script globally innuxt.config.ts, with data-await-hydration set to the string "true":
nuxt.config.ts
- Keep it synchronous: don’t add
async,deferortype: "module". - Nuxt 3 and 4: pagent recognizes their hydration. On Nuxt 2, pagent can’t detect hydration, so leave out
data-await-hydrationthere. - Navigation with
<NuxtLink>andnavigateTois tracked automatically.
Check it worked
- Deploy, then open your site in a private browser window.
- Back in pagent, click Check connection in the install step.
- Open a test’s preview link and check that the variant shows and stays after the page has finished loading.