# Add Ishara to SvelteKit

Add the feedback widget to a SvelteKit app by pasting one script tag before the closing body tag of src/app.html, the page template.

- Where it goes: `src/app.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 `src/app.html`, your page template, and paste the line just before `</body>`. SvelteKit only fills in its `%sveltekit.…%` placeholders in this file, so the tag reaches the browser as written:

```html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    %sveltekit.head%
  </head>
  <body data-sveltekit-preload-data="hover">
    <div style="display: contents">%sveltekit.body%</div>
    <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

- Use `src/app.html` rather than `<svelte:head>` in a layout: that’s meant for per-page titles and meta tags, and every page already renders inside `app.html`.
- If you turn on SvelteKit’s nonce-based Content Security Policy, add `nonce="%sveltekit.nonce%"` to the tag.

Checked against the official docs on 2026-11-12: [SvelteKit: project structure](https://svelte.dev/docs/kit/project-structure), [SvelteKit: the app.html template](https://github.com/sveltejs/cli/blob/main/packages/sv/src/create/templates/minimal/src/app.html).
