VisitorLeadVisitorLead
Frameworks (Advanced)

Vite (React, Vue, Svelte)

Install VisitorLead in any Vite app via index.html.

Open index.html at the project root and add the script inside <head>:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <script
      id="visitorleadjs"
      async
      src="https://ingest.visitorlead.tech/vl.js"
      data-code="YOUR_SITE_CODE"
    ></script>
  </head>
  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.tsx"></script>
  </body>
</html>

Works for any Vite-powered framework — React, Vue, Svelte, Preact, SolidJS.

Verify

Run vite (or your dev script) and visit your site. VisitorLead → Sessions should record the session.

Official references

On this page