# Add Ishara to Astro

Add the feedback widget to an Astro site with one script tag, marked is:inline, before the closing body tag of your shared layout.

- Where it goes: Your shared layout, 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 the layout your pages share, such as `src/layouts/Layout.astro`, and paste the line just before `</body>`, adding `is:inline` so Astro leaves it exactly as written:

```
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>My site</title>
  </head>
  <body>
    <slot />
    <script is:inline src="https://useishara.com/w.js" data-site="pk_…" defer></script>
  </body>
</html>
```

3. Build and deploy the site.
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

- Pages that don’t use this layout don’t get the widget. If you have several layouts, add the line to each, or to one they all share.
- Don’t load the widget from a framework component’s `useEffect` or `onMount`: that only runs once the island hydrates, and only on pages that include it.
- Astro adds no Content Security Policy of its own. 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: [Astro: scripts and event handling](https://docs.astro.build/en/guides/client-side-scripts/), [Astro: template directives](https://docs.astro.build/en/reference/directives-reference/), [Astro: layouts](https://docs.astro.build/en/basics/layouts/).
