Helpway Docs

React SDK

Drop-in component, provider, and headless hooks. Use what you need — skip what you don't.

@helpway/react exposes three integration layers, in order of control:

  1. <HelpwayWidget> — one-line drop-in. Renders the default themed chat UI. 90% of integrations stop here.
  2. <SupportProvider> + <DefaultWidget> — same default UI, but split so you can mount the provider higher and access widget APIs via hooks.
  3. <SupportProvider> + headless hooks — bring your own UI. Conversation list, timeline, composer, presence — all exposed as plain React hooks.

Layer 1: HelpwayWidget

Simplest path. Mount once at the root of your app.

import { HelpwayWidget } from "@helpway/react";
 
<HelpwayWidget apiKey="pk_live_xxx" />

Props

PropTypeDefaultNotes
apiKeystringRequired. Public key from Settings → API Keys.
apiUrlstringhttps://api.helpway.aiOverride for staging / self-hosted.
localestringauto-detect"tr", "en", "de"… Falls back to Accept-Language.
initialConversationIdstringDeep link: auto-open a specific conversation.
onReady(api) => voidFired once bootstrap finishes. Gives { identify, openConversation }.

Programmatic control via onReady

<HelpwayWidget
  apiKey="pk_live_xxx"
  onReady={(api) => {
    api.identify({
      userId: "u_12345",
      email: "user@acme.com",
      name: "Jane Doe",
    });
  }}
/>

Layer 2: Provider + Default UI

Useful when you want the default chat UI and want to call widget APIs from deeper in the tree.

import { SupportProvider, DefaultWidget, useWidget } from "@helpway/react";
 
function App() {
  return (
    <SupportProvider apiKey="pk_live_xxx">
      <YourApp />
      <DefaultWidget />
    </SupportProvider>
  );
}

Layer 3: Headless hooks

Build your own chat UI. Helpway handles auth, transport, caching, and realtime — you handle rendering.

import { SupportProvider, useTimeline, useComposer } from "@helpway/react";
 
function ChatPanel({ conversationId }) {
  const { items, isLoading } = useTimeline(conversationId);
  const { send, isSending } = useComposer(conversationId);
 
  return (
    <div>
      {items.map((item) => <Message key={item.id} item={item} />)}
      <MyComposer onSubmit={send} disabled={isSending} />
    </div>
  );
}

Available hooks

HookPurpose
useWidget()The imperative API: identify, openConversation, open, close.
useConversations()List of the visitor's conversations, paginated.
useTimeline(id)Messages + events for one conversation, realtime-updated.
useComposer(id)send, isSending, attachment helpers.
usePresence()Is a teammate currently online?
useUnread()Total unread count — hook into your own notification bell.
useRealtime()Low-level: subscribe to raw realtime events.