
Company News
Andrew Becherer Joins Socket as Chief Information Security Officer
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.
@unith-ai/react-native
Advanced tools
React Native WebView wrapper for the Unith AI digital human SDK. This package embeds the existing web SDK inside a WebView and bridges events/commands via postMessage.
npm install @unith-ai/react-native react-native-webview
import { UnithConversationView } from "@unith-ai/react-native";
export default function Screen() {
return (
<UnithConversationView
style={{ height: 420 }}
options={{
orgId: "YOUR_ORG_ID",
headId: "YOUR_HEAD_ID",
apiKey: "YOUR_API_KEY",
language: "en-US",
username: "React Native User",
dataTag: "custom-data",
}}
onStatusChange={status => console.log("Status:", status)}
onConnect={data => console.log("Connected:", data)}
onDisconnect={data => console.log("Disconnected:", data)}
onMessage={msg => console.log("Message:", msg)}
onSuggestions={suggestions => console.log("Suggestions:", suggestions)}
onSpeakingStart={() => console.log("Speaking started")}
onSpeakingEnd={() => console.log("Speaking ended")}
onError={error => console.log("Error:", error)}
/>
);
}
import { WebView } from "react-native-webview";
import { useConversation } from "@unith-ai/react-native";
export default function Screen() {
const convo = useConversation(
{
orgId: "YOUR_ORG_ID",
headId: "YOUR_HEAD_ID",
apiKey: "YOUR_API_KEY",
language: "en-US",
username: "React Native User",
dataTag: "custom-data",
},
{
onStatusChange: status => console.log("Status:", status),
onConnect: data => console.log("Connected:", data),
onDisconnect: data => console.log("Disconnected:", data),
onMessage: msg => console.log("Message:", msg),
onSuggestions: suggestions => console.log("Suggestions:", suggestions),
onSpeakingStart: () => console.log("Speaking started"),
onSpeakingEnd: () => console.log("Speaking ended"),
onError: error => console.log("Error:", error),
onSpeechRecognitionToken: token => console.log("Token:", token),
}
);
return <WebView ref={convo.webViewRef} {...convo.webViewProps} />;
}
For a complete working example, check out the React Native example.
onStatusChange - Fired when the conversation status changesonConnect - Fired when connection is establishedonDisconnect - Fired when disconnectedonMessage - Fired when a message is receivedonSuggestions - Fired when suggestions are availableonSpeakingStart - Fired when the digital human starts speakingonSpeakingEnd - Fired when the digital human stops speakingonTimeoutWarning - Fired as a warning before session timeoutonTimeout - Fired when the session times outonKeepSession - Fired to keep the session aliveonMuteStatusChange - Fired when mute status changesonError - Fired when an error occursonStoppingStart - Fired to signal we're in the process of stopping a response.onStoppingEnd - Fired to signal a response has been completely stopped.onSpeechRecognitionToken - Fired when the speech recognition token is generated.The useConversation hook returns an object with the following methods:
startSession() - Start a new conversation sessionendSession() - End the current sessionsendMessage(text) - Send a text messagetoggleMute() - Toggle output mute statuskeepSession() - Keep the session alivestopResponse() - Stop an ongoing responsegenerateSpeechRecognitionToken() - Generate a new speech recognition token.orgId - Organization ID (required)headId - Digital human head ID (required)apiKey - API key for authentication (required)language - Language code (e.g., "en-US", default: undefined)username - Username for the session (default: undefined)dataTag - Custom data that can be used for analytics. (default: undefined)FAQs
React Native WebView wrapper for Unith AI digital humans
The npm package @unith-ai/react-native receives a total of 47 weekly downloads. As such, @unith-ai/react-native popularity was classified as not popular.
We found that @unith-ai/react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket’s first CISO brings deep experience securing high-growth SaaS companies as open source supply chain threats accelerate.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.