# Add Ishara to Nuxt

Add the feedback widget to a Nuxt 3 or 4 app with one script entry in app.head in nuxt.config.ts, placed at the end of the body.

- Where it goes: `app.head.script` in `nuxt.config.ts`
- 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 `nuxt.config.ts`, add the script to `app.head.script`. Each property becomes an attribute of the tag, and `tagPosition: 'bodyClose'` puts it at the end of `<body>`:

```
export default defineNuxtConfig({
  app: {
    head: {
      script: [
        {
          src: 'https://useishara.com/w.js',
          defer: true,
          'data-site': 'pk_…',
          tagPosition: 'bodyClose',
        },
      ],
    },
  },
})
```

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**.

## With useHead() instead

You can add the same script with `useHead()` in your root component: `app/app.vue` in Nuxt 4, `app.vue` in Nuxt 3. Use the root component, not a page, so it loads everywhere.

```
<script setup lang="ts">
useHead({
  script: [
    { src: 'https://useishara.com/w.js', defer: true, 'data-site': 'pk_…', tagPosition: 'bodyClose' },
  ],
})
</script>
```

## Good to know

- Use `app.head` or `useHead()`, never `useHeadSafe()`: it keeps only a few safe attributes and drops `src`, `defer` and `data-site`.
- Without `tagPosition`, Nuxt puts the script in `<head>`, which works too because it’s deferred.

Checked against the official docs on 2026-11-12: [Nuxt: SEO and meta](https://nuxt.com/docs/4.x/getting-started/seo-meta), [Nuxt: head in nuxt.config](https://nuxt.com/docs/4.x/api/nuxt-config#head), [Nuxt: useHead](https://nuxt.com/docs/4.x/api/composables/use-head), [Nuxt: useHeadSafe](https://nuxt.com/docs/4.x/api/composables/use-head-safe).
