Skip to main content

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 createWebHistory is tracked automatically. With createWebHashHistory, send a navigate command after each route change:

Nuxt

Add the script globally in nuxt.config.ts, with data-await-hydration set to the string "true":
nuxt.config.ts
  • Keep it synchronous: don’t add async, defer or type: "module".
  • Nuxt 3 and 4: pagent recognizes their hydration. On Nuxt 2, pagent can’t detect hydration, so leave out data-await-hydration there.
  • Navigation with <NuxtLink> and navigateTo is tracked automatically.
See Frameworks for the shared rules and the Content Security Policy.

Check it worked

  1. Deploy, then open your site in a private browser window.
  2. Back in pagent, click Check connection in the install step.
  3. Open a test’s preview link and check that the variant shows and stays after the page has finished loading.