React

AssistifyScript renders the loader. useAssistify drives Webchat.

npm install @assistifychat/widget

Render the script

Drop <AssistifyScript> into your root layout. It's a server component:

import { AssistifyScript } from '@assistifychat/widget/react';
 
export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        {children}
        <AssistifyScript widgetId="WIDGET_ID" />
      </body>
    </html>
  );
}

Pre-fill the visitor identity through the identity prop:

<AssistifyScript
  widgetId="WIDGET_ID"
  identity={{ email: visitor.email, userHash: visitor.userHash }}
/>

Boot-time identity needs a valid userHash. Without a hash the identity is ignored and the widget logs a console warning. The prop does not carry customAttributes: send them with useAssistify().user.identify(...) on the client, which also records an unverified identity. See Identity verification.

Drive from a component

'use client';
import { useAssistify } from '@assistifychat/widget/react';
 
export function SupportButton() {
  const widget = useAssistify({ widgetId: 'WIDGET_ID' });
  return <button onClick={() => widget.chat.open()}>Support</button>;
}

useAssistify returns the same handle on every call. The widget is a page-level singleton; it survives unmounts and StrictMode double-renders. Its options are read on the first call only, and when <AssistifyScript> already rendered the script, the script's own props apply.

Panel-only (your own launcher)

Set launcher={false} on the script to render the chat panel without the floating launcher, then open it from your own control:

<AssistifyScript widgetId="WIDGET_ID" launcher={false} />
'use client';
import { useAssistify } from '@assistifychat/widget/react';
 
export function HelpButton() {
  const widget = useAssistify({ widgetId: 'WIDGET_ID' });
  return <button onClick={() => widget.chat.open()}>Help</button>;
}

Without <AssistifyScript>, pass launcher: false to useAssistify instead. Closing the panel hides it completely. See Panel-only (custom launcher) for what else stays off the page.

Other frameworks

There's no /vue or /svelte subpath. Call mount() from a module-level setup file so it runs once per page rather than once per component: it adds the script itself. The handle behaves exactly like the one useAssistify returns.

Tell your visitors

Your privacy policy should mention the chat. See Visitor recognition → Your privacy policy for the two notices to link.