IsharaBeta
Install guides (31)

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 (set when you add the site)
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:

    app/root.tsx
    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 />.

Next

Once reviewers leave notes, your coding agent can apply them. The widget’s options (language, position, colour, launcher) are in the docs.