Docs / Getting started / Install the widget

Install the widget

Every way to get AskThis onto a site: the universal embed, the WordPress and Shopify plugins, and the npm package for React, Vue and Next.

Universal embed

The universal embed works on any site that lets you add a script tag. Paste it just before the closing </body> tag:

<script async
  src="https://cdn.askthis.io/widget.js"
  data-site-id="cq_8f2a">
</script>

The script is async and under 12KB gzipped — it never blocks rendering, and it renders inside a Shadow DOM so it can’t touch your styles. If it can’t load, it fails silently and your page renders as if it were never there.

WordPress

Install the AskThis plugin from the WordPress plugin directory, then paste your site ID on the plugin’s settings page. The plugin injects the widget and your AI Graph tags automatically — no theme edits required.

Shopify

Add the AskThis app from the Shopify App Store. The embedded app injects the widget on product, collection and article pages, and understands product context (price, availability, variants) for AI prompts.

React, Vue and Next

For component-based stacks, install the package for your framework:

npm install @askthis/react   # React and Next.js
npm install @askthis/vue     # Vue 3

Then render the component where you want the buttons to appear. In Next.js, <AskThis /> is a client component — use it inside a "use client" component.

import { AskThis } from "@askthis/react";

<AskThis siteId="cq_8f2a" layout="inline" />
<script setup>
import { AskThis } from "@askthis/vue";
</script>

<template>
  <AskThis site-id="cq_8f2a" layout="inline" />
</template>

On any other stack (Svelte, Angular, vanilla JS), use the framework-free loader instead — npm install @askthis/embed gives you createWidget(element, { siteId }), which returns a cleanup function for route changes.

All three are thin wrappers that inject the same edge-served script as the universal embed — bundle impact stays minimal, and every configuration option is identical.

After installing

Whichever route you take, finish with Verify installation in the dashboard — it confirms the widget’s first event has arrived. Then head to Configure buttons to choose platforms, layout and theme.