> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cuprice.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Vue

> Embed Cuprice in a Vue 3 app (Vite, Nuxt)

## Vue 3 (Composition API)

```vue theme={null}
<template>
  <div data-cuprice-id="YOUR_SHARE_ID"></div>
</template>

<script setup>
import { onMounted, onUnmounted } from "vue";

let script;
onMounted(() => {
  script = document.createElement("script");
  script.src = "https://app.cuprice.io/embed.js";
  script.async = true;
  document.body.appendChild(script);
});

onUnmounted(() => {
  if (script) document.body.removeChild(script);
  if (window.Cuprice) window.Cuprice.destroy();
});
</script>
```

## Nuxt 3

Use the `useHead` composable:

```vue theme={null}
<template>
  <div data-cuprice-id="YOUR_SHARE_ID"></div>
</template>

<script setup>
useHead({
  script: [
    { src: "https://app.cuprice.io/embed.js", async: true }
  ]
});
</script>
```

> [!WARNING]
>
> Call `window.Cuprice.destroy()` on unmount to clean up event listeners and observers.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.