Web Assist
How to install Instro Web Assist
Generate your widget in the dashboard, then install it with the instro-web-assist npm package for modern app projects or copy your Instro snippet into the stack that matches your website.
Choose the installation method for your website
Before you start
Get your installation details
Copy the snippet generated in your Instro dashboard. Your user ID is the value attached to the identifying attribute in that snippet.
Go to dashboardChoose one install path
App project? Use the npm package for React, Next.js or another JavaScript bundler.
Simple site or CMS? Use the complete dashboard snippet for HTML, CMS platforms, ecommerce templates and no-build websites.
Choose your platform
npm
npm package
For modern JavaScript apps, install the official Instro Web Assist SDK from npm and initialise it once near the root of your app.
How to install
- 1Install the package with `npm install instro-web-assist`.
- 2Import `InstroWebAssist` in your app entry, root component, or a small client-only widget module.
- 3Call `InstroWebAssist.init()` once with the user ID from your Instro dashboard.
Example
TSnpm install instro-web-assist
import InstroWebAssist from "instro-web-assist";
InstroWebAssist.init({
userId: "YOUR_INSTRO_USER_ID",
});Use the npm package when your site is built with a JavaScript bundler. Use the dashboard snippet for no-build sites, CMS platforms and simple template installs.
HTML
HTML website
For plain HTML or simple server-rendered pages, paste the Instro snippet just before the closing body tag.
How to install
- 1Open the HTML file or shared footer template used by your site.
- 2Paste your Instro dashboard snippet just before `</body>`.
- 3Save, upload and refresh a live page to verify the widget loads.
Example
HTML<script
src="YOUR_INSTRO_WIDGET_URL/MudDt5Fdr.js"
data-user-id="YOUR_INSTRO_USER_ID"
defer
><\/script>
</body>Using `defer` keeps the script from blocking the initial HTML parse in standard websites.
React
React site
For React apps, use the React component from the `instro-web-assist` npm package and mount it once at the root.
How to install
- 1Install the SDK with `npm install instro-web-assist`.
- 2Import `InstroWebAssist` from `instro-web-assist/react`.
- 3Render that component once near the bottom of your root app component.
Example
TSXnpm install instro-web-assist
import { InstroWebAssist } from "instro-web-assist/react";
export default function App() {
return <InstroWebAssist userId="YOUR_INSTRO_USER_ID" />;
}You can still use the dashboard script snippet if you prefer a script-tag install.
Next.js
Next.js site
For Next.js, install the npm package and render the React component from a small client component.
How to install
- 1Install the SDK with `npm install instro-web-assist`.
- 2Create a client component that imports `InstroWebAssist` from `instro-web-assist/react`.
- 3Render that component once from your root layout so it appears across the site.
Example
TSX"use client";
import { InstroWebAssist } from "instro-web-assist/react";
export default function WebAssistWidget() {
return <InstroWebAssist userId={process.env.NEXT_PUBLIC_INSTRO_USER_ID} />;
}Keep the user ID in a public environment variable only if it is intended to be available in browser code.
Vue
Vue site
For Vue, load the widget after mount so the DOM exists and the script only runs on the client.
How to install
- 1Add the script in `onMounted()` inside `App.vue` or your global layout.
- 2Guard against duplicates with a fixed script id.
- 3Clean it up in `onUnmounted()` if that root component can be replaced.
Example
VUEonMounted(() => {
if (document.getElementById("instro-web-assist")) return;
const script = document.createElement("script");
script.id = "instro-web-assist";
script.src = "YOUR_INSTRO_WIDGET_URL/MudDt5Fdr.js";
script.defer = true;
script.dataset.userId = "YOUR_INSTRO_USER_ID";
document.body.appendChild(script);
});Vue’s `onMounted()` hook is intended for DOM-related side effects and does not run during SSR.
Nuxt
Nuxt site
For Nuxt, register the external script with `useHead()` and place it at the end of the body so it loads globally.
How to install
- 1Open `app.vue` so the widget loads across every route.
- 2Add the script through `useHead()` with `tagPosition: bodyClose`.
- 3Keep the `data-user-id` on the script element and publish the site.
Example
VUEuseHead({
script: [{
key: "instro-web-assist",
src: "YOUR_INSTRO_WIDGET_URL/MudDt5Fdr.js",
defer: true,
tagPosition: "bodyClose",
"data-user-id": "YOUR_INSTRO_USER_ID",
}],
});Nuxt head management supports body-close scripts directly. If you prefer package-based setup, use the npm guide above.
WordPress
WordPress site
For WordPress, the quickest path is a Custom HTML block. For a site-wide install, place the snippet in your footer template or code injection area.
How to install
- 1In the block editor, add a Custom HTML block where you want the widget to be available.
- 2Paste your Instro dashboard snippet into that block and update the page.
- 3For a site-wide install, add the same snippet to your footer template or site-wide code injection area.
Example
HTML<script
src="YOUR_INSTRO_WIDGET_URL/MudDt5Fdr.js"
data-user-id="YOUR_INSTRO_USER_ID"
defer
><\/script>On WordPress.com, script tags require hosting-enabled plans. On self-hosted installs, the user may need permission to use unfiltered HTML.
Wix
Wix site
For Wix, add the Instro snippet through Custom Code settings so it loads globally without editing raw template files.
How to install
- 1Publish the site and make sure it has a connected domain.
- 2Open the site dashboard, go to Settings, then Custom Code in Development & integrations.
- 3Select Add Custom Code, paste the snippet, apply it to All pages and place it at Body - end.
- 4Choose to load it once per visit, then apply and test the live site.
Example
HTML<script
src="YOUR_INSTRO_WIDGET_URL/MudDt5Fdr.js"
data-user-id="YOUR_INSTRO_USER_ID"
defer
><\/script>For a chat widget, Body - end is the safest default placement.
Shopify
Shopify store
For Shopify, edit the theme code and place the widget in `theme.liquid` before the closing body tag so it loads across the storefront.
How to install
- 1From Shopify admin, go to Online Store, Themes, then Edit code.
- 2Open `layout/theme.liquid` in your active theme.
- 3Paste the Instro snippet just before `</body>`, save and preview the storefront.
Example
LIQUID / HTML<script
src="YOUR_INSTRO_WIDGET_URL/MudDt5Fdr.js"
data-user-id="YOUR_INSTRO_USER_ID"
defer
><\/script>
</body>Duplicate your theme before editing code so you have a rollback point.
PHP
PHP website
For PHP sites, add the widget to the shared footer or layout partial so every page inherits it automatically.
How to install
- 1Open the shared footer include used by your PHP templates.
- 2Paste the Instro snippet just before the closing `</body>` tag.
- 3Deploy the updated file and test a live page.
Example
PHP / HTML<script
src="YOUR_INSTRO_WIDGET_URL/MudDt5Fdr.js"
data-user-id="YOUR_INSTRO_USER_ID"
defer
><\/script>
</body>If your PHP site uses multiple layouts, install the widget in the one shared by every page so it only loads once.
Troubleshooting
Widget does not appear
Check that the script is present in the final page HTML, appears only once, and that you published the change to the live site rather than only saving locally.
Console shows script or CSP errors
If your site uses a Content Security Policy, allow the Instro script origin in `script-src` and the API origin used by your widget in `connect-src`.
It loads twice
The snippet may have been added in both a global layout and an individual page. Keep only one installation path.
Framework route changes behave oddly
Move the install to the root app layout so the script stays attached once instead of reloading on every page transition.