heytappr.book a demo

install guide

heytappr + react

add heytappr to a react app (vite or similar) with one script tag in index.html.

where it goes

in a vite react app the script goes in index.html at the project root, just before the closing body tag. it loads once and stays put while react re-renders underneath it.

index.htmlhtml
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>my app</title>
  </head>
  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.tsx"></script>
    <script src="https://cdn.tappr.app/embed.js" data-tapprid="your-business"></script>
  </body>
</html>

things worth knowing

  • don't inject the script from a component. index.html runs it once per page load, which is what you want.

  • give the controls your guides point at stable ids or data attributes. styling classes change often and break selectors.

  • allowlist your web origin in the heytappr workspace, or the embed won't load. add every origin you serve from, including staging.

questions

does it work with react router?

yes. the script lives outside your component tree, so client-side route changes don't reload it.

is there a react package to install?

no. it's one script tag, no npm package and no provider to wrap your app in.

what teams do next

other stacks