v1.1.0 - Cross-Origin REST Routing and Auth Fixes
What's Changed
Fixed
-
Cross-origin REST routing — All REST API calls (messages, stickers, sounds, moderation, geo restrictions, auth, exports) now correctly route to
serverUrlwhen set. Previously, 13 hooks and components used a hard-coded same-origin base URL, causing 404s when<RelayaChat>was embedded in a third-party host app.RelayaServerContextnow distributesserverUrlthrough the React tree automatically. -
Cross-origin auth popup — The login popup URL was built from
window.location.origin(the host app's domain) instead ofserverUrl's origin. For cross-origin embedders, this opened the popup on a domain with no auth route, breaking login entirely. ThepostMessageorigin check had the same problem. Both are fixed: they now usenew URL(serverUrl).originwhenserverUrlis set. -
Font-face CSS warning — Removed a broken
@font-facedeclaration that referenced a missing asset and generated a console warning on every load.
Changed
buildWsUrl()JSDoc now explicitly notes this helper is for same-origin / iframe use only. Cross-origin SDK consumers should derive their WebSocket URL fromserverUrl(replacehttps://withwss://).
Removed
API_BASE_URLconstant removed fromconfig.ts— it was always""and became dead code after the cross-origin REST routing fix.
Documentation
CHANGELOG.mdcreated with entries for all releases.serverUrlprop documentation clarifies it covers both REST and WebSocket connections; Troubleshooting section added for cross-origin 404 errors.- Added
@relaya-chat/react-nativepackage README. - Corrected prop name typos in root README Quick Start examples.
Upgrade Notes
If you are embedding <RelayaChat serverUrl="https://api.relaya.chat" spaceSlug="your-space" /> in a third-party React app, upgrade to v1.1.0 immediately — previous versions silently routed all REST calls and the auth popup to the host app's origin, resulting in 404 errors and broken login.
No API changes — this is a drop-in upgrade.