
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
react-native-parlant
Advanced tools
A React Native library for integrating Parlant AI agents into your React Native / Expo / React applications.
A React Native library for integrating Parlant AI agents into your React Native, Expo, and React applications.
npm install react-native-parlant
import React from "react";
import { useChat } from "react-native-parlant";
function ChatComponent() {
const { messages, sendMessage, isLoading, isTyping } = useChat({
agentId: "your-agent-id",
api: "https://your-parlant-api.com",
customerId: "user-123",
title: "Customer Support Chat",
});
const handleSendMessage = async (text: string) => {
try {
await sendMessage(text);
} catch (error) {
console.error("Failed to send message:", error);
}
};
return (
<div>
{/* Render your chat UI here */}
{messages.map((message) => (
<div key={message._id}>
<strong>{message.user.name}: </strong>
{message.text}
</div>
))}
{isTyping && <div>Agent is typing...</div>}
{/* Your message input component */}
</div>
);
}
useChat(props: Props)The main hook for managing chat sessions with Parlant AI agents.
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
agentId | string | ✅ | - | The ID of the Parlant AI agent |
api | string | ✅ | http://localhost:8800 | The Parlant API endpoint |
initialMessages | IMessage[] | ❌ | [] | Initial messages to populate the chat |
moderation | string | ❌ | "auto" | Moderation setting for messages |
customerId | string | ❌ | "guest" | Unique identifier for the customer |
title | string | ❌ | "New Conversation" | Title for the chat session |
maxRetries | number | ❌ | 3 | Maximum retries for message fetching |
headers | Record<string, string> | ❌ | {} | Custom headers for API requests |
aiAvatar | string | ❌ | "" | Avatar URL for AI agent messages |
| Property | Type | Description |
|---|---|---|
messages | IMessage[] | Array of chat messages |
sendMessage | (message: string) => Promise<MessageEvent> | Function to send a message |
isLoading | boolean | Whether a message is being sent |
isTyping | boolean | Whether the agent is currently typing |
append(currentMessages, newMessages, inverted?)Utility function for appending messages to the chat.
currentMessages (TMessage[]) - Existing messages arraynewMessages (TMessage[]) - New messages to appendinverted (boolean, default: true) - Whether to prepend (true) or append (false) messagesIMessageinterface IMessage {
_id: string | number;
text: string;
createdAt: Date | number;
user: {
_id: string | number;
name?: string;
avatar?: string | number | renderFunction;
};
image?: string;
video?: string;
audio?: string;
system?: boolean;
sent?: boolean;
received?: boolean;
pending?: boolean;
quickReplies?: QuickReplies;
}
MessageEventinterface MessageEvent {
id: string;
source: string;
kind: "message" | "status";
offset: number;
creation_utc: string;
correlation_id: string;
data: {
message: string;
participant: {
id: string;
display_name: string;
};
flagged: boolean;
tags: string[];
status?: "typing" | "ready";
};
deleted: boolean;
}
Sessioninterface Session {
id: string;
agent_id: string;
customer_id: string;
creation_utc: string;
title: string;
mode: string;
consumption_offsets: {
client: number;
};
}
const { messages, sendMessage } = useChat({
agentId: "your-agent-id",
api: "https://your-api.com",
headers: {
Authorization: "Bearer your-token",
"X-Custom-Header": "custom-value",
},
});
const initialMessages: IMessage[] = [
{
_id: 1,
text: "Hello! How can I help you today?",
createdAt: new Date(),
user: {
_id: 2,
name: "AI Assistant",
avatar: "https://example.com/avatar.png",
},
},
];
const { messages, sendMessage } = useChat({
agentId: "your-agent-id",
api: "https://your-api.com",
initialMessages,
});
const handleSendMessage = async (text: string) => {
try {
await sendMessage(text);
} catch (error) {
if (error.message === "Failed to send message") {
// Handle send failure
console.error("Message failed to send");
} else if (error.message === "Failed to create session") {
// Handle session creation failure
console.error("Could not establish chat session");
}
}
};
MIT
Contributions are welcome! Please feel free to submit a Pull Request.
For questions and support, please visit icookandcode or open an issue on GitHub.
Keywords: react-native, react, parlant, ai, agent, chat, conversation, typescript
FAQs
A React Native library for integrating Parlant AI agents into your React Native / Expo / React applications.
We found that react-native-parlant 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.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.