Documentation

Overview

MatchWiser is an AI lead qualification widget you embed on your website. Visitors open a chat, the AI qualifies them naturally, and only the best-fit leads receive your call-to-action.

The system has two parts:

The widget

A JavaScript file you embed on your site. Handles the chat UI, sends messages to your proxy, and triggers the CTA on qualification.

The proxy server

A Node.js server you deploy on your own infrastructure. Holds your LLM API key, validates requests, and streams AI responses. Visitor data never leaves your server.

NoteMatchWiser is self-hosted. You are responsible for deploying and maintaining your proxy server. We have no access to your visitors' conversations or lead data.

Quick start

From purchase to live widget in under 15 minutes.

1

Configure your widget

Use the onboarding editor to describe your product and ideal customer. The AI generates your widget's conversation flow, qualification criteria, and visual settings.
2

Purchase and download

Choose the DIY ($99) or Done-with-you ($299) plan. You'll receive a download link by email containing your widget JS file and proxy server template.
3

Deploy the proxy

Use the included Railway template to deploy your proxy in one click. Set your LLM API key and widget token secret as environment variables.
4

Embed the widget

Paste the script tag and MatchWiser.init() call into your HTML just before </body>. Your widget is live.
TipThe onboarding editor has a live preview — you can see exactly how your widget looks and behaves before purchasing.

Embedding the widget

Add a container element and the widget script to your HTML. Everything below is pre-filled in your download — you only need to copy and paste.

1. Add a container

Place an empty <div> where you want the widget to appear. The id must match containerId in your config.

<div id="my-widget"></div>

2. Load the script and initialise

<script src="/matchwiser.iife.js"></script>
<script>
  MatchWiser.init({
    widgetId:    "your-widget-id",
    propId:      "your-prop-id",
    widgetToken: "your-widget-token",
    containerId: "my-widget",
    name:        "Your Company",
    mode:        "embedded",
    language:    "en",
    llm: {
      provider: "anthropic",
      model:    "claude-sonnet-4-6",
      proxyUrl: "https://your-proxy.railway.app",
    },
    theme: {
      primaryColor: "#8833FF",
      colorScheme:  "dark",
    },
    // ... rest of your generated config
  });
</script>
NoteHost matchwiser.iife.js on your own server or CDN — do not hotlink it from matchwiser.com. The file is included in your download.

Deploying the proxy

The proxy is a Node.js (Express) server included in your download as a Railway-ready template. It acts as a secure intermediary between your widget and the LLM provider — your API key stays on the server, never in the browser.

Deploy to Railway

1

Click the deploy button

Deploy on Railway → Railway will provision the proxy from a pre-built image — no source code or GitHub repo required on your end.
2

Set environment variables

Railway prompts you for the required variables during setup. At minimum you need WIDGET_TOKEN_SECRET and your LLM API key. See the Environment variables section below for the full list.
3

Copy your public URL

Railway assigns a public HTTPS URL once the deploy is healthy. Paste it as llm.proxyUrl in your widget's init config.
TipRailway's free tier works for testing. For production, the Hobby plan (~$5/mo) gives you always-on uptime with no sleep delays.

Environment variables

Set these in your Railway project's Variables tab (or in a .env file for local development).

VariableRequiredDescription
WIDGET_TOKEN_SECRETYesSecret used to verify widget JWTs. Must match the secret used when your widget token was generated. Keep this private.
ANTHROPIC_API_KEYIf using AnthropicYour Anthropic API key. Get one at console.anthropic.com.
OPENAI_API_KEYIf using OpenAIYour OpenAI API key. Get one at platform.openai.com.
ALLOWED_ORIGINSRecommendedComma-separated list of allowed CORS origins, e.g. https://yoursite.com. Restricts which domains can call your proxy.
PORTNoHTTP port. Railway sets this automatically — you don't need to set it manually.
NoteNever expose WIDGET_TOKEN_SECRET or API keys in client-side code. These live only in your server environment.

Widget options

The full list of fields accepted by MatchWiser.init(). All required fields are generated for you during onboarding.

Root

FieldTypeDescription
widgetIdstring (UUID)Unique ID for this widget. Generated during onboarding.
propIdstringIdentifier for the property (website) that owns this widget.
widgetTokenstringSigned JWT that authenticates this widget to your proxy.
containerIdstringID of the DOM element where the widget renders.
namestringYour company or product name. Shown in the widget header.
mode'embedded' | 'fullscreen'embedded renders a section on your page. fullscreen takes over the viewport.
languagestring (BCP 47)Default conversation language, e.g. "en", "pt-BR", "ja". The AI auto-detects and follows the visitor's language after their first message.

theme

FieldTypeDescription
primaryColorhex stringBrand color for buttons and accents. Default: #8833FF.
backgroundColorhex | 'transparent'Chat panel background. transparent inherits the page background.
colorScheme'dark' | 'light'Controls text and UI colours inside the widget.
borderRadiusnumber (0–32)Corner radius in px for chat bubbles and the panel.
fontFamilystringCSS font-family. Use any font already loaded on the page.
logoUrlURL stringOptional company logo shown in the widget header.
maxWidthCSS stringMax width of the embedded section, e.g. "600px".
sectionHeightCSS stringFixed height of the embedded section, e.g. "480px". Defaults to auto.

flow

FieldTypeDescription
greetingstringOpening message shown before the visitor types.
typingIndicatorTextstringText shown while the AI is generating a response.
maxTurnsnumberMax conversation turns before the CTA is shown. Default: 10.
customInstructionsstringFree-text instructions injected into the system prompt. Define persona, tone, and product-specific rules here.
knowledgeBaseUrlsstring[]Up to 5 URLs the proxy fetches at session start and injects as context. See Knowledge base.

Lead webhooks

When a visitor qualifies (or clicks your CTA), the proxy can POST the lead data to any URL you control — your CRM, a Slack webhook, Airtable, Make, Zapier, or your own endpoint. Set the LEADS_WEBHOOK_URL environment variable on your proxy to enable it.

Payload

{
  "event": "lead.qualified" | "lead.converted",
  "timestamp": "2026-01-01T00:00:00.000Z",
  "widgetId": "...",
  "sessionId": "...",
  "company": {
    "name": "Acme Inc.",
    "domain": "acme.com",
    "industry": "Software",
    "employeeCount": 120,
    "country": "US",
    "technologies": ["React", "Salesforce"]
  },
  "qualification": {
    "fitResult": "qualified" | "unqualified" | "unknown",
    "matchedSignals": ["company size", "industry"],
    "missingSignals": []
  }
}

The lead.qualified event fires when the AI determines the visitor matches your ICP. lead.converted fires when the visitor clicks your CTA button.

Signature verification

Set LEADS_WEBHOOK_SECRET on your proxy to sign every request. Each delivery will include an X-MatchWiser-Signature header containing an HMAC-SHA256 of the raw request body. Verify it on your endpoint to confirm the payload came from your proxy and was not tampered with.

TipMost webhook-receiving services (Make, Zapier, n8n) accept the payload as-is without signature verification. For production CRM integrations, always verify the signature.
VariableDescription
LEADS_WEBHOOK_URLURL the proxy POSTs lead events to. Any HTTP/HTTPS endpoint.
LEADS_WEBHOOK_SECRETOptional HMAC-SHA256 signing secret. Included as X-MatchWiser-Signature on each request.

Knowledge base

Pass URLs in flow.knowledgeBaseUrls to give the AI access to product-specific information. The proxy fetches each URL at session start, strips the HTML, and injects the plain text into the AI's system prompt.

Good URLs to include

  • Your product features or use-cases page
  • Pricing page
  • FAQ or support page
  • Case studies or customers page
  • Integration or API documentation

Limits

LimitValue
Max URLs5
Max characters per URL12,000
Total max context~60,000 characters
TipPages with clean, text-heavy HTML work best. JavaScript-rendered content (SPAs) may not be fetched correctly — prefer static pages or plain-text endpoints.
NoteKnowledge base URLs are fetched at session start, which adds a small delay before the first AI response. Avoid URLs that are slow to load or require authentication.

Language support

MatchWiser supports multilingual conversations. Set a default language for the AI's opening messages — it automatically switches to whatever language your visitor uses.

Setting the default language

MatchWiser.init({
  // ...
  language: "pt-BR",   // opens in Brazilian Portuguese
});

Supported languages

TagLanguage
enEnglish (default)
pt-BRPortuguese (Brazil)
esSpanish
frFrench
deGerman
itItalian
nlDutch
plPolish
jaJapanese
koKorean
zh-CNChinese (Simplified)
arArabic
hiHindi
ruRussian
trTurkish
svSwedish
daDanish
fiFinnish
TipEven with a default language set, the AI follows the visitor's language after their first message. A Portuguese-speaking visitor on an English widget automatically gets Portuguese replies.

Updating your widget

There are two kinds of updates: changing your configuration and updating the widget JS version. Both can be done at any time without re-purchasing.

Updating your configuration

Your configuration lives entirely inside the MatchWiser.init({ ... }) call in your HTML. Edit it directly — change the greeting, update your ICP description, adjust colors, add knowledge base URLs. The change takes effect on the next page load with no re-deployment required.

NoteThe widgetId, propId, and widgetToken fields are generated and must not be changed. Everything else is editable.

Updating the JS file

When a new version of the widget is available, replace matchwiser.iife.js on your server with the new file. No configuration changes are required unless the release notes say otherwise.

TipPin the script to a versioned filename (e.g. matchwiser-1.2.0.iife.js) so you can roll back instantly by changing one line of HTML.

Updating the proxy

The proxy source code is included in your download. When a new proxy version is released, update the files in your GitHub repo and Railway will redeploy automatically.

FAQ

Still have questions?

We're a small team and we read every message.

Contact us →