# Add Ishara to React Router and Remix

Add the feedback widget to a React Router or Remix app with one script tag in the Layout export of app/root.tsx, so it’s on every route.

- Where it goes: The `Layout` export in `app/root.tsx`
- Allowed domains: your own domain
- Time: about 3 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. In `app/root.tsx`, paste the line inside `<body>` in the `Layout` export, next to `<Scripts />` (add the export as below if your file doesn’t have one). JSX takes the tag as it is:

```
import { Links, Meta, Outlet, Scripts, ScrollRestoration } from "react-router";

export function Layout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <head>
        <meta charSet="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <Meta />
        <Links />
      </head>
      <body>
        {children}
        <script src="https://useishara.com/w.js" data-site="pk_…" defer></script>
        <Scripts />
        <ScrollRestoration />
      </body>
    </html>
  );
}

export default function App() {
  return <Outlet />;
}
```

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

- `Layout` also wraps the error boundary and the hydration fallback, so the widget loads on every route, error pages included.
- React Router’s docs now cover version 8; the `root.tsx` and `Layout` conventions are the same as in version 7.
- If you use a nonce-based Content Security Policy, give the tag the same `nonce` you pass to `<Scripts />`.

Checked against the official docs on 2026-11-12: [React Router: root.tsx](https://reactrouter.com/api/framework-conventions/root.tsx), [React Router: Scripts](https://reactrouter.com/api/components/Scripts), [React Router: routing](https://reactrouter.com/start/framework/routing).
