GitHub - ghostchat-dev/widget: ~10KB chat widget. Zero cookies. Zero tracking. Fully open source. · GitHub
/" data-turbo-transient="true" />
Skip to content
Search or jump to...
Search code, repositories, users, issues, pull requests...
-->
Search
Clear
Search syntax tips
Provide feedback
--><br>We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
Saved searches
Use saved searches to filter your results more quickly
-->
Name
Query
To see all available qualifiers, see our documentation.
Cancel
Create saved search
Sign in
/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
ghostchat-dev
widget
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star
main
BranchesTags
Go to file
CodeOpen more actions menu
Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit
History<br>4 Commits<br>4 Commits
dist
dist
src
src
.gitignore
.gitignore
LICENSE
LICENSE
README.md
README.md
package-lock.json
package-lock.json
package.json
package.json
tsconfig.json
tsconfig.json
View all files
Repository files navigation
GhostChat Widget
~10KB chat widget. Zero cookies. Zero tracking. Fully open source.
This is the open source client-side widget that powers GhostChat — a lightweight, privacy-first live chat for websites.
Quick Start
Add this script tag to your site:
">script src="https://api.ghostchat.dev/widget.js" data-site="YOUR_SITE_ID" async>script>
Sign up at ghostchat.dev to get your site ID.
What's Inside
A single TypeScript file that compiles to ~10KB gzipped. No frameworks, no dependencies.
WebSocket real-time messaging — instant two-way communication
File & image uploads — up to 5MB with inline preview, tap to open full-size
Typing indicators — both visitor and agent, in real time
Page journey tracking — SPA-aware, shows agents which pages the visitor browsed
Visitor identity — optional name and email capture, required during away hours
Presence detection — green/orange status dot, online/away via visibilitychange and beforeunload
Quick links — configurable shortcut buttons above the message input
URL auto-linking — URLs in messages become clickable links automatically
Notification sounds — synthesized audio ding, no external files
Unread badge — shows count on the launcher button
Dark mode — respects prefers-color-scheme
Customizable — position, colors, icon, welcome message via data-* attributes
Privacy by Design
Don't take our word for it — read the code:
grep "document.cookie" → 0 results — no cookies, ever
grep "analytics\|tracking\|pixel" → 0 results — no tracking scripts
grep "fingerprint" → 0 results — no browser fingerprinting
localStorage keys : only 5 (ghostchat_session_id, ghostchat_session_secret, ghostchat_email, ghostchat_name, ghostchat_tooltip_shown)
All API calls go to your GhostChat API domain only — no third-party requests
No CDN dependencies, no external fonts, no iframes from other domains
Size Comparison
Widget<br>Gzipped Size<br>Cookies<br>Tracking
GhostChat<br>~10KB<br>None<br>None
Intercom<br>~200KB+<br>Yes<br>Yes
Tawk.to<br>~200KB<br>Yes<br>Yes
Tidio<br>~200KB+<br>Yes<br>Yes
Crisp<br>~140KB<br>Yes<br>Yes
LiveChat<br>~120KB<br>Yes<br>Yes
Build from Source
git clone https://github.com/jacoborbach/ghostchat-widget.git<br>cd ghostchat-widget<br>npm install<br>npm run build
The built widget will be at dist/widget.js.
How It Works
The widget is a single IIFE (Immediately Invoked Function Expression) that:
Auto-detects the API URL from the tag's src attribute
Creates a shadow-DOM-free chat UI injected at the end of
Opens a WebSocket connection for real-time messaging
Falls back to polling if WebSocket fails
Stores only a session ID in localStorage — no cookies, no fingerprinting
Self-Hosting Note
This widget connects to GhostChat's hosted API. You need a GhostChat account to use it. Sign up free — no credit card required.
Architecture
See How Our Widget Works for a visual breakdown of the architecture, privacy guarantees, and size comparisons.
License
MIT — see LICENSE.
Built by GhostChat.
About
~10KB chat widget. Zero cookies. Zero tracking. Fully open source.
ghostchat.dev/how-our-widget-works
Topics
chat
lightweight
open-source
privacy
typescript
websocket
chat-widget
live-chat
no-tracking
no-cookies
Resources
Readme
License
MIT license
Uh oh!
There was an error while loading. Please reload this page.
Activity
Custom properties
Stars
stars
Watchers
watching
Forks
forks
Report repository
Releases
No releases published
Packages
Uh oh!
There was an error while loading. Please reload this page.
Contributors
Uh...