IsharaBeta
Install guides (31)

Add Ishara to Next.js

Add the feedback widget to a Next.js app with the Script component from next/script, in your root layout or your custom _app file.

Where it goes
app/layout.tsx (or pages/_app.js)
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 your root layout, app/layout.tsx, import Script from next/script and add it inside <body>, after {children}. Next.js forwards extra attributes such as data-site to the final <script>, and the root layout covers every route:

    app/layout.tsx
    import Script from "next/script";
    
    export default function RootLayout({ children }: { children: React.ReactNode }) {
      return (
        <html lang="en">
          <body>
            {children}
            <Script src="https://useishara.com/w.js" data-site="pk_…" strategy="afterInteractive" />
          </body>
        </html>
      );
    }
  3. Deploy the change as usual.

  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.

Pages Router

With the Pages Router, add the same Script to your custom pages/_app.js, after the page component:

pages/_app.js
import Script from "next/script";

export default function MyApp({ Component, pageProps }) {
  return (
    <>
      <Component {...pageProps} />
      <Script src="https://useishara.com/w.js" data-site="pk_…" strategy="afterInteractive" />
    </>
  );
}

Good to know

  • Keep strategy at afterInteractive (the default) or lazyOnload. Next.js keeps beforeInteractive for scripts such as bot detectors and cookie consent managers.
  • The root layout can stay a Server Component: a Script without event handlers such as onLoad doesn’t need "use client".
  • If you send a Content Security Policy with a nonce, pass nonce={nonce} to Script, or allow the widget’s origin in script-src (details).

Next

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