Skip to main content
Joghd
Engineering

Keeping the chat widget under 15 KB

A chat widget that slows the host site down gets removed sooner or later. A report on the engineering decisions that protected our budget.

The Joghd Team1 min read

The Joghd widget gets installed on sites that care about their own Core Web Vitals. Every kilobyte we add comes out of their budget, so we set the ceiling at 15 KB compressed from day one and enforced it as a failing test in CI.

The decisions

  • No framework in the initial loader — plain DOM only
  • The full conversation UI loads only after the first user click
  • Fonts self-hosted, and only the Persian subset
  • No polyfills; older browsers get a simplified build

The result: adding the widget to a typical page moves LCP by under 30 ms and has no effect on CLS at all, because the button's dimensions are reserved before it loads.

Back to blog

Ship your first agent tonight

Add one knowledge source, set the tone, copy the widget snippet. Under ten minutes.

No card required · 50 free messages · Live in under 10 minutes