A WebRTC video calling and real-time chat toolkit for React Native and NestJS. The packages provide signaling, UI hooks/components, and callback hooks so host apps can add auth, persistence, and business logic.
- WebRTC video calling with Socket.IO signaling
- Real-time chat with typing indicators, read receipts, delete, and history hooks
- Room-based communication
- Call overlay and video call screen for React Native
- TypeScript support
- Extensible NestJS modules via
forRoot({ callbacks })
NestJS server module for video calling and chat signaling.
npm install @nightfuryequinn/rtc-made-simple-serverPeer dependencies: @nestjs/common, @nestjs/core, @nestjs/websockets, @nestjs/platform-socket.io, socket.io, class-validator, class-transformer.
import { VideoCallModule, ChatModule } from '@nightfuryequinn/rtc-made-simple-server';
@Module({
imports: [
VideoCallModule.forRoot({
callbacks: {
canConnect: async (callerName) => Boolean(callerName),
onCallCreated: async (caller, receiver, conversationId) => {},
onCallEnded: async (caller, receiver, status) => {}
}
}),
ChatModule.forRoot({
callbacks: {
onMessageSent: async (sender, receiver, message, room, metadata) => {
// Return { messageId } to control IDs used by clients
},
onGetMessages: async (roomName, limit) => []
}
})
]
})
export class AppModule {}React Native components and hooks for video calling and chat.
npm install @nightfuryequinn/rtc-made-simple-ui
npm install socket.io-client react-native-webrtc react-native-incall-manager zustandimport { useVideoSocket, ChatWindow, CallOverlay } from '@nightfuryequinn/rtc-made-simple-ui';
const { initiateCall, acceptCall, declineCall } = useVideoSocket({
currentUser: 'user123',
baseUrl: 'http://your-server.com'
});
<ChatWindow
userName="user123"
roomName="general"
baseUrl="http://your-server.com"
/>The RTC-Made-Simple-Example folder contains:
- Backend (NestJS): ValidationPipe, in-memory chat history, Swagger
- Mobile (Expo): Video call + chat demo
Build the libraries first (examples depend on the local package directories):
cd RTC-Made-Simple-Server && npm install && npm run build
cd ../RTC-Made-Simple-UI && npm install && npm run buildStart the backend:
cd RTC-Made-Simple-Example/example-backend
npm install
npm run devStart the mobile app:
cd RTC-Made-Simple-Example/example-mobile
npm install
npm start| Environment | Default server URL |
|---|---|
| iOS simulator | http://localhost:3000 |
| Android emulator | http://10.0.2.2:3000 |
| Physical device | Set EXPO_PUBLIC_RTC_SERVER_URL=http://YOUR_LAN_IP:3000 |
Use two devices/emulators with different device names. Enter the other device's displayed name as the call target.
- Client connects to
/chatwithuserName+roomName sendMessageincludes optionalclientMessageId- Server persists via callback, emits
newMessageto room peers andmessageAckto sender - Clients reconcile optimistic IDs;
getMessages/messageHistoryload history messageRead,deleteMessage, andtypingfan out to the room
- Clients connect to
/calland stay in a home room named after themselves - Caller joins the receiver room, emits
incomingCall - Receiver accepts then both open
VideoCallScreen, join the receiver room, emitpeerReady - Caller sends WebRTC offer (
newCall), receiver answers (callAnswered), ICE viaICEcandidate - Hang up / decline / cancel / disconnect returns peers home and invokes
onCallEnded
This toolkit is signaling-only. It does not ship authentication, authorization, or durable storage.
- Implement
canConnect(and preferably token-based handshake auth) before production - Add rate limiting and content moderation for chat
- Use TURN servers for reliable NAT traversal
- Serve over HTTPS/WSS in production
- Treat
callerName/userNamequery params as untrusted unless verified
Client (rtc-made-simple-ui)
useVideoSocket / VideoCallScreen / ChatWindow
| Socket.IO
Server (rtc-made-simple-server)
VideoCallGateway (/call) ChatGateway (/chat)
VideoCallService ChatService
| callbacks | callbacks
Host app persistence / auth / notifications
MIT