@fishaudio/agent-widget-react-native 0.0.0-stage → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Fish Audio
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,71 @@
1
- # Temporary Holding Version
1
+ # @fishaudio/agent-widget-react-native
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A drop-in voice agent for React Native apps, for [Fish Audio](https://fish.audio) agents. One component renders a floating button that opens a call panel with a live transcript, text input, mute, client-tool activity, an optional consent step, and a minimized in-call pill. It is the React Native counterpart of the web [`<fish-agent>` widget](https://www.npmjs.com/package/@fishaudio/agent-widget), built on [`@fishaudio/agent-react-native`](https://www.npmjs.com/package/@fishaudio/agent-react-native).
4
+
5
+ The UI is ready-made. To draw your own, use `useConversation` from `@fishaudio/agent-react-native` instead.
6
+
7
+ **Full documentation:** [React Native widget](https://github.com/fishaudio/fish-agent-sdk/blob/main/docs/react-native-widget.md), covering every prop, theming, and the differences from the web widget.
8
+
9
+ ## Requirements
10
+
11
+ - The [React Native SDK](https://docs.fish.audio/agents/deploy/react-native) set up first: its native dependencies, the config plugin (Expo) or the bare React Native steps, and a native build. Expo Go cannot run WebRTC.
12
+ - React Native 0.76 or later and React 18 or later, like the SDK, with either of its LiveKit lines (2.12 / WebRTC 144.1, or 3.2+ / 150.2+).
13
+ - `react-native-svg` 15 or later, which draws the icons. It is a native module, so rebuild the app after installing it.
14
+ - A backend that creates session tokens with your API key (recommended), or a public agent. Never ship the API key in the app.
15
+
16
+ ## Install
17
+
18
+ ```sh
19
+ npx expo install @fishaudio/agent-widget-react-native react-native-svg
20
+ ```
21
+
22
+ Bare React Native: `npm install @fishaudio/agent-widget-react-native react-native-svg`, then `cd ios && pod install`.
23
+
24
+ ## Use
25
+
26
+ Render it last in your root view, so it floats above the app and stays mounted across screens. Unmounting the widget ends its call.
27
+
28
+ ```tsx
29
+ import { FishAgentWidget } from "@fishaudio/agent-widget-react-native";
30
+ import { Platform, View } from "react-native";
31
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
32
+
33
+ export default function App() {
34
+ const insets = useSafeAreaInsets();
35
+ return (
36
+ <View style={{ flex: 1 }}>
37
+ <YourApp />
38
+ <FishAgentWidget
39
+ sessionTokenProvider={() =>
40
+ fetch("https://api.example.com/agent-session", { method: "POST" }).then((r) => r.json())
41
+ }
42
+ insets={insets}
43
+ clientTools={{ get_device_info: () => ({ os: Platform.OS }) }}
44
+ />
45
+ </View>
46
+ );
47
+ }
48
+ ```
49
+
50
+ For a public agent, pass `agentId` instead of `sessionTokenProvider`. If the agent restricts origins, also pass `origin` with one of its allowed origins (experimental).
51
+
52
+ Common props:
53
+
54
+ | Prop | Description |
55
+ |---|---|
56
+ | `sessionTokenProvider` / `agentId` | How a call starts: your backend's token, or a public agent. |
57
+ | `agentName`, `greeting`, `proactiveMessage` | Header title, home screen line, bubble next to the button. A public agent's dashboard settings fill these in; props win. |
58
+ | `consent`, `consentStorage` | Ask before the first call; remember the answer across launches with e.g. AsyncStorage. |
59
+ | `clientTools`, `onCall` | Client tools for every call; adjust the session options right before a call starts. |
60
+ | `insets`, `position`, `draggable` | Safe-area insets, the corner, and whether the user can drag the button. |
61
+ | `avatar`, `launcherIcon` | Your images instead of the orb and the button icon: `require("./avatar.png")` or `{ uri }`. |
62
+ | `theme`, `colorScheme` | Colors and sizes; `light`, `dark` or `system`. |
63
+ | `callNotification`, `audioOutput` | Android call notification; initial audio route. |
64
+ | `onConnect`, `onDisconnect`, `onError` | Call events. |
65
+
66
+ A ref exposes `expand()` to open the panel from your own button.
67
+
68
+ ## Notes
69
+
70
+ - Tool chips show each tool call's input, output and error to the user. To keep tool data off the device, create sessions with `tool_events: false` on your backend, or set `options.toolEvents = false` in `onCall` for a public agent.
71
+ - React Native has no audio levels, so the orb and the bars animate by the agent's mode (listening, thinking, speaking) instead of following the voice.
@@ -0,0 +1,57 @@
1
+ Third-party notices for @fishaudio/agent-widget-react-native
2
+ ========================================================================
3
+
4
+ This package redistributes the third-party software listed below.
5
+ The corresponding license texts are reproduced in full.
6
+
7
+ Contents:
8
+ - lucide (icon path data) n/a (ISC)
9
+
10
+ ========================================================================
11
+ lucide (icon path data) n/a — ISC
12
+ ========================================================================
13
+
14
+ ISC License
15
+
16
+ Copyright (c) 2026 Lucide Icons and Contributors
17
+
18
+ Permission to use, copy, modify, and/or distribute this software for any
19
+ purpose with or without fee is hereby granted, provided that the above
20
+ copyright notice and this permission notice appear in all copies.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
23
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
24
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
25
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
26
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
27
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
28
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
29
+
30
+ ---
31
+
32
+ The following Lucide icons are derived from the Feather project:
33
+
34
+ airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
35
+
36
+ The MIT License (MIT) (for the icons listed above)
37
+
38
+ Copyright (c) 2013-present Cole Bemis
39
+
40
+ Permission is hereby granted, free of charge, to any person obtaining a copy
41
+ of this software and associated documentation files (the "Software"), to deal
42
+ in the Software without restriction, including without limitation the rights
43
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
44
+ copies of the Software, and to permit persons to whom the Software is
45
+ furnished to do so, subject to the following conditions:
46
+
47
+ The above copyright notice and this permission notice shall be included in all
48
+ copies or substantial portions of the Software.
49
+
50
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
51
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
52
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
53
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
54
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
55
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
56
+ SOFTWARE.
57
+