# Add Ishara to React (Vite)

Add the feedback widget to a React app built with Vite by pasting one script tag before the closing body tag of your index.html.

- Where it goes: `index.html`, before `</body>`
- Allowed domains: your own domain
- Time: about 2 minutes

## Steps

1. In Ishara, open **Sites → your site → Install** and copy the line under **Add the line to your site**. Your site’s key is already in it:

```html
<script src="https://useishara.com/w.js" data-site="pk_…" defer></script>
```

2. Open `index.html` at the root of your project (not inside `public/`) and paste the line just before `</body>`, after your app’s module script. Vite only processes module scripts and stylesheets in this file, so it leaves the tag as it is:

```html
<!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://useishara.com/w.js" data-site="pk_…" defer></script>
  </body>
</html>
```

3. Build and deploy the app.
4. Open your site. Back on the **Install** page, **Check it’s live** turns into **The widget is live** as soon as the widget loads. Then open the **Reviewer link** from the same page: only people who open it see **Leave a note**.

## Good to know

- Every route of a single-page app is served from this one `index.html`, so one tag covers the whole app.
- Vite adds no Content Security Policy. If your host sends one, allow the widget’s origin in `script-src` ([details](https://useishara.com/docs#csp)).

Checked against the official docs on 2026-11-12: [Vite: getting started](https://vite.dev/guide/), [Vite: building for production](https://vite.dev/guide/build), [Vite: backend integration](https://vite.dev/guide/backend-integration).
