Releases: relaya-chat/sdk
Release list
v2.0.0-beta.8 - Fix gravatar style selection
Fixed
@relaya-chat/react- Gravatar style selection now shows the correct image after a selection is made. Previously the selected style was not applied correctly, causing the wrong avatar image to be displayed after choosing a gravatar style.
Maintenance
- Upgraded
vite(8.0->8.1) andundicidevDependencies to resolve 2 high-severity CVEs. These are build-time tools only and are not included in published packages.
Published to npm under the next dist-tag (pre-release). No new server requirements - minimum server version remains v1.7.0.
v2.0.0-beta.7 - RN Audio Notifications & Modal Positioning Fix
What's New
@relaya-chat/react-native - Audio notifications for @mention and @channel events
React Native apps can now play sounds when users are mentioned or a channel-wide alert fires. Two new options on useRelayaChat:
onMentionNotification(soundUrl)- fires onmention:notificationWS eventonChannelNotification(soundUrl)- fires onchannel:notificationWS event
Two new state fields on RelayaChatState:
mentionSoundUrl- fetched on mount from the server (space-specific or default)channelSoundUrl- fetched on mount from the server (space-specific or default)
The SDK does not play audio itself - your app supplies an expo-av (or equivalent) handler in the callbacks. Sound URLs are always populated (non-null) after a successful mount. Requires Relaya server v1.7.0 or later for custom sounds; falls back gracefully on earlier versions (callbacks still fire, URLs still populated with server defaults).
Fixed
@relaya-chat/react - Modal positioning fix
All six modals (ChatNameEditor, BanModal, ReportModal, UserListModal, AuthModal, GravatarStyleModal) now center within the widget container at any embed width. Previously, modals used position: fixed and were positioned relative to the viewport, causing them to appear off-screen or misaligned when the widget was embedded as a narrow column alongside other page content.
Compatibility
- Requires Relaya server v1.7.0 or later for custom sound upload support; default sounds and notification events (including the new RN callbacks) work on all server versions. This release is coordinated with Relaya server v1.7.0.
- All other compatibility requirements unchanged from v2.0.0-beta.6.
v2.0.0-beta.6 - Terms of Service Acceptance
What's new
Terms of Service acceptance support (all packages)
Auth responses now include termsAccepted, termsUrl, and termsVersion fields. When a space admin enables ToS enforcement, users who haven't accepted the current terms see termsAccepted: false. Call acceptTerms() to record acceptance and unlock chat access.
@relaya-chat/react- Built-inTermsAcceptanceScreengates the chat UI. No integration change required for<RelayaChat />consumers.@relaya-chat/react-native-termsAccepted,termsUrl,termsVersiononuseRelayaAuthstate;acceptTerms()onuseRelayaChat. Headless - host app renders ToS UI when!auth.termsAccepted && auth.termsUrl.- Backward compatible - Older servers omit these fields; SDK defaults
termsAccepted: true.
Requires Relaya server v1.6.0 or later for ToS enforcement to take effect.
Fixed
@relaya-chat/react-native-useRelayaChatnow fetcheshideDeletedMessagesfrom the server on mount. Usechat.hideDeletedMessages(notauth.station?.hideDeletedMessages) to drive deleted-message rendering.
Published to npm under the next dist-tag (pre-release):
npm install @relaya-chat/react@next
npm install @relaya-chat/react-native@next
npm install @relaya-chat/core@next
v2.0.0-beta.5 - RN fix for hideDeletedMessages
Fixed
- react-native:
useRelayaChatnow correctly honors the spacehideDeletedMessagessetting. Previously, the setting was not being applied, meaning deleted messages may have been shown or hidden regardless of the space admin's configuration.
Packages
@relaya-chat/react-native@2.0.0-beta.5@relaya-chat/react@2.0.0-beta.5@relaya-chat/core@2.0.0-beta.5
Install (pre-release - use next dist-tag):
npm install @relaya-chat/react-native@next
npm install @relaya-chat/react@nextv2.0.0-beta.4 - Sticker Refresh & Moderation Token Fix
v2.0.0-beta.4 - Sticker Refresh & Moderation Token Fix
Added
@relaya-chat/react-native:onStickersUpdatedoption onuseRelayaChat, invoked when the server broadcasts astickers:updatedWS event. Brings React Native's sticker-refresh behavior in line with@relaya-chat/react.
Fixed
@relaya-chat/react+@relaya-chat/react-native: REST-based moderation actions (deleteMessage,banUser,reportMessage,editMessage,blockUser,unblockUser) now refresh the access token before calling the API, fixing intermittent stale-token 401 failures during long-lived sessions.@relaya-chat/react:UserListnow shows blocked users who are currently offline, so the Unblock control stays available after a blocked user disconnects.
No new server requirements - minimum server version remains v1.5.0. Published to npm under the next dist-tag (prerelease).
v2.0.0-beta.3 - User-to-User Blocking
What's new
- User-to-user blocking -
blockUser()/unblockUser()onuseRelayaChat
(react + react-native), backed by new server block endpoints. New
blockedUserIdsstate field.@relaya-chat/reactadds a "Block user" menu
item and an "Unblock" affordance in the user list. Part of Apple App Store
Guideline 1.2 (UGC) compliance.
Compatibility
Requires Relaya server v1.5.0 or later for blocking; earlier servers
work but omit the block feature.
Notes
This is still a pre-release (next npm tag) - not latest. No new breaking
changes since beta.2.
v2.0.0-beta.2 - hideDeletedMessages Documentation Clarification
Documentation
-
All packages — Clarified that
hideDeletedMessagesonAuthStation/RelayaAuthStationis a read-only, server-set value. It reflects the space-level admin setting configured at relaya.chat and is populated by the server when the auth hook loads station data. SDK consumers should read this field to decide whether to hide deleted message rows in their UI, but must not attempt to set or pass it as a configuration option. The correct usage pattern:const hideDeleted = auth.station?.hideDeletedMessages ?? false;
v2.0.0-beta.1 - Leaner Bundle, API Keys, Auth Reliability
Breaking Changes
@relaya-chat/react — Admin panel removed from SDK. The AdminPanel component, AdminPanelProps type, @relaya-chat/react/admin subpath export, and reorderStickersByFilename helper are gone. Space administration now lives natively at relaya.chat /account. Consumers of <RelayaChat> need no changes.
@relaya-chat/react — clearTokenFromUrl() removed and magicLinkToken removed from RelayaChatConfig. These were remnants of the old magic-link sign-in flow the server no longer supports. Remove any calls to clearTokenFromUrl() and any magicLinkToken field passed to parseConfig().
Added
All packages — apiKey prop for per-space API key enforcement. Pass the key generated in the relaya.chat space admin under Integration & security as apiKey to <RelayaChat>, useRelayaAuth, and useRelayaChat. Sent as X-Relaya-Api-Key on REST requests and ?apiKey= on WebSocket upgrade. Omitting is a no-op. Requires Relaya server v1.3.0 for enforcement.
Fixed
@relaya-chat/react — Cross-tab refresh lease released on unmount; page reload reconnects immediately instead of waiting up to ~30 seconds. Tab coordinator is dispose-safe: broadcasts to a closed BroadcastChannel are ignored rather than throwing.
Installing
npm install @relaya-chat/react@next @relaya-chat/core@next
# React Native:
npm install @relaya-chat/react-native@next @relaya-chat/core@nextv1.4.0 - React Native toolkit and Expo Basic example both complete
v1.4.0 - React Native toolkit and Expo Basic example both complete
What's New
@relaya-chat/react-native is now production-ready with a complete auth model:
useRelayaAuthrewritten to the AT/RT (access/refresh token) model. Handles OTP sign-in, token refresh, and sign-out. Stores tokens inAsyncStoragevia an injected adapter so consumers control the storage implementation.useRelayaChatupdated to AT/RT model — WebSocket connections attach a fresh access token on each connect attempt; auth failures close the socket cleanly for a re-auth cycle.- Expo Basic example app (
packages/react-native/examples/expo-basic): a runnable demo with sign-in, message list, message composer, and presence bar.
Fixed
- Re-render loop in
useRelayaAuthcaused by an unstabilised callback reference inside auseEffectdependency array. - JWT decode path and
tsconfigcorrections in the Expo Basic example. - New Architecture (
newArchEnabled: true) enabled in Expo Basicapp.jsonto suppress Expo Go warnings.
Documentation
- Server minimum-version requirements added to all three package READMEs.
- React Native package README rewritten to reflect the AT/RT auth model.
v1.3.0 - Fix Auth Session Corruption in Multi-tab Sessions
Fixed
Multi-tab token refresh coordination (@relaya-chat/react)
When several browser tabs are open simultaneously, each tab previously ran its own refresh timer — causing two tabs to call /auth/refresh with the same token at once. One tab would invalidate the other's newly rotated tokens, triggering spurious re-authentication. A localStorage lease now elects a single leader tab to perform each refresh; a BroadcastChannel propagates the new tokens to all other tabs. Falls back to race-aware refresh where BroadcastChannel is unavailable.
Race-aware token refresh (@relaya-chat/react)
clearStoredRefreshTokenIfCurrent() prevents a "losing" tab from wiping a "winning" tab's freshly rotated refresh token. On a 401, the SDK now re-reads localStorage before giving up — if another tab has already succeeded, it retries with the new token rather than ending the session. Authenticated WebSocket connections now call ensureFreshToken() before the upgrade, preventing a stuck reconnect loop caused by sending an expired access token on the initial WS handshake.
Scroll-to-bottom reliability (@relaya-chat/react)
Removed scroll-behavior: smooth from the message list container and the isProgrammaticScrollRef / 500 ms suppression workaround. The initial jump to the bottom is now instant; smooth scrolling is preserved for new messages arriving while the view is already at the bottom. Resolves the ↓ button vanishing in active chats.