You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dd26e9b
Browse filesBrowse the repository at this point in the historyBrowse files
exportdeclareconstBRIDGE_SHIM_JS="\n(function() {\n if (window.__chattyBridgeInstalled) { return true; }\n window.__chattyBridgeInstalled = true;\n // MessageEvent's constructor only accepts a Window or MessagePort for\n // 'source' (not a generic EventTarget, and definitely not a plain object\n // literal) \u2014 a MessagePort from a throwaway MessageChannel is the only\n // one of those we can actually construct standalone. Its native\n // postMessage is shadowed with our own override (own-property lookup\n // beats the prototype's), so the port itself is never really used to\n // send anything, only to satisfy the type check and as a stable\n // identity for the page's own 'e.source !== window.parent' filter.\n var fakeParent = new MessageChannel().port1;\n fakeParent.postMessage = function(data) {\n try { window.ReactNativeWebView.postMessage(JSON.stringify(data)); } catch (e) {}\n };\n try {\n Object.defineProperty(window, 'parent', { get: function() { return fakeParent; }, configurable: true });\n } catch (e) {}\n window.__chattyDeliver = function(json) {\n try {\n var data = JSON.parse(json);\n window.dispatchEvent(new MessageEvent('message', { data: data, source: fakeParent }));\n } catch (e) {}\n };\n // Suppress raw browser window.alert() calls (e.g. \"Browser push notifications\n // are not supported on this browser\" from EmbedClient.tsx) which would otherwise\n // render as a jarring browser dialog.\n try {\n window.alert = function(msg) {\n try { console.log('[ChattyBridge] alert suppressed: ' + msg); } catch (e) {}\n };\n } catch (e) {}\n // Intercept getUserMedia so native host knows mic access was requested.\n try {\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n var _origGUM = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices);\n navigator.mediaDevices.getUserMedia = function(constraints) {\n try { fakeParent.postMessage({ type: 'chatty:mic-requested' }); } catch (e) {}\n return _origGUM(constraints);\n };\n }\n } catch (e) {}\n // Intercept geolocation so native host knows location access was requested.\n try {\n if (navigator.geolocation && navigator.geolocation.getCurrentPosition) {\n var _origGCP = navigator.geolocation.getCurrentPosition.bind(navigator.geolocation);\n navigator.geolocation.getCurrentPosition = function(success, error, options) {\n try { fakeParent.postMessage({ type: 'chatty:location-requested' }); } catch (e) {}\n return _origGCP(success, error, options);\n };\n }\n } catch (e) {}\n true;\n})();\n";
4
4
exportinterfaceChattyEmbedViewProps{
5
5
botId: string;
6
+
/** Opens the standalone LiveKit voice surface instead of the normal chat surface. */
7
+
voiceOnly?: boolean;
6
8
/** Overrides the embed page's own host (defaults to the production site). */
7
9
baseUrl?: string;
8
10
/** Called once the embed page has finished loading and is interactive (chatty:ready). */
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "@personaliai/react-native",
3
-
"version": "1.1.0",
3
+
"version": "1.2.0",
4
4
"description": "Official React Native SDK for Chatty AI chatbots — loads the web widget in a WebView for guaranteed parity, with native components as an alternative",
0 commit comments