Skip to content
All projects

Embeddable AI Intake Assistant

An embeddable chat widget that drops onto any law-firm website with one script tag — qualifying new leads and answering existing clients’ case questions.

  • One-script-tag embed
  • Multi-tenant
  • No secret in the browser
TypeScriptAzure Bot Framework v4Direct LineMicrosoft WebChatrestify (Node 20)Azure App ServiceAzure OpenAIMySQLRedis

Built at CloudLex

The problem

Law firms needed a 24/7 intake channel on their marketing sites; phone and contact forms leaked after-hours leads and offered no self-service for existing clients.

What I built

  • A zero-dependency UMD widget mounts a floating avatar and Microsoft WebChat UI from a single script tag.
  • It exchanges a public token for a short-lived Direct Line token, so no secret ever reaches the browser.
  • A join handshake passes per-firm identity to the bot, which resolves the right configuration and flow — new-lead capture or OTP-gated existing-client lookup.

How it fits together

Law-firm site (script tag)Embeddable widget (UMD)Direct Line token exchangeBot Framework bot (App Service)Per-firm config (MySQL + Redis)Azure OpenAI tool-callingLead created / case answered

Key technical decisions

No secret in the browser

The widget only ever holds a short-lived Direct Line token obtained via token exchange — the long-lived secret stays server-side.

Per-firm behaviour, one deployment

Firm configuration and feature flags drive prompts, tools, and flows, so a single bot serves many firms with no code forks.

Framework-free widget

Built the widget in vanilla JS so the host page pays no framework tax — it works as a global, an ES import, or a CommonJS require.

Outcomes

  • 24/7 lead capture plus existing-client self-service
  • Multi-tenant from a single deployment
  • Drops into any site with one tag

Proprietary — source not public.

Want to talk through any of this?

jntkhandebharad@gmail.com