Skip to content

docs: complete the list of paths required for ChatWidget behind auth gateways#570

Merged
sojan-official merged 4 commits into
chatwoot:mainfrom
rf-leon:docs/add-widget-iframe-path
May 31, 2026
Merged

docs: complete the list of paths required for ChatWidget behind auth gateways#570
sojan-official merged 4 commits into
chatwoot:mainfrom
rf-leon:docs/add-widget-iframe-path

Conversation

@rf-leon

@rf-leon rf-leon commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

The Enabling ChatWidget for Users section in restricted-instances.mdx listed only three paths (/cable, /api/v1/widget/*, /packs). That is incomplete for self-hosted Chatwoot deployments behind auth gateways such as Cloudflare Access, basic auth, ZTNA, or an internal reverse proxy.

This PR documents the additional public paths the widget needs to render and load its assets reliably.

Missing paths this documents

Path What it serves Symptom when blocked
/widget The iframe HTML the SDK loads to render the chat UI SDK script loads but no chat bubble appears
/vite/assets JS / CSS bundles for the iframe in newer Chatwoot versions Iframe HTML loads but renders blank
/brand-assets Installation branding such as the widget footer logo Broken branding image in the widget
/rails/active_storage Stored attachment URLs served through Rails Active Storage Images/files in widget conversations can appear broken or inaccessible

What this change does

  • Adds a Widget Page subsection documenting /widget as a required public path.
  • Expands Widget Assets to include /packs, /vite/assets, /brand-assets, and /rails/active_storage.
  • Clarifies that visitor uploads use the existing /api/v1/widget/* API path, while stored attachment URLs use /rails/active_storage/....
  • Notes that external storage providers can redirect from /rails/active_storage/... to signed provider/CDN URLs, so visitors must also be able to reach that provider hostname.

Validation

  • Verified /widget against config/routes.rb and app/javascript/sdk/IFrameHelper.js in the Chatwoot app.
  • Verified the widget iframe loads Vite assets through app/views/widgets/show.html.erb.
  • Verified default branding assets under /brand-assets from installation config and widget branding code.
  • Verified attachment display URLs use Rails Active Storage paths, while visitor uploads are handled by widget API endpoints.
  • Ran git diff --check.

rf-leon added 2 commits May 4, 2026 15:15
…ents

The widget SDK injects an iframe pointing to /widget?website_token=...
This path must be publicly reachable for the chat bubble to render, but
was missing from the list of required paths in the restricted-instances
guide. Self-hosters who put Chatwoot behind any auth gate (Cloudflare
Access, basic auth, ZTNA) will see the SDK script load but no chat
bubble appear without this bypass.
Newer Chatwoot versions migrated the widget UI from Webpack to Vite. The
JS and CSS bundles inside the iframe are now served from /vite/assets
rather than /packs. Without bypassing this path, the iframe page (/widget)
loads but its bundles fail, producing a blank widget.

Updates the Widget Assets section to document both /packs (SDK loader)
and /vite/assets (iframe bundles), with a note about the migration so
operators of older deployments understand both paths matter.
@rf-leon rf-leon changed the title docs: add /widget iframe path to restricted-instances widget requirements docs: document /widget and /vite/assets paths required for ChatWidget behind auth May 4, 2026
Two more paths the widget pulls from that aren't currently documented:

- /brand-assets serves the installation logo shown in the widget footer.
- /rails/active_storage serves image and file attachments — both visitor
  uploads and media the agent sends back. Without this bypassed, agent-
  sent images display as broken on the visitor side because their HTTP
  GETs are intercepted by the auth gateway.

Restructures the Widget Assets section to list all four paths the widget
loads from, with a one-line description of what each serves, so the next
operator behind an auth gateway can configure all bypasses in one pass
rather than discovering them sequentially through user reports.
@rf-leon rf-leon changed the title docs: document /widget and /vite/assets paths required for ChatWidget behind auth docs: complete the list of paths required for ChatWidget behind auth gateways May 4, 2026

@sojan-official sojan-official left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this

@sojan-official sojan-official merged commit 314bf28 into chatwoot:main May 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants