Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Build cross-platform VoIP calling apps with React Native using Telnyx Voice SDK. High-level reactive API with automatic lifecycle management, CallKit/ConnectionService integration, and push notifications. Use for mobile VoIP apps with minimal setup.
.claude/skills/team-telnyx-telnyx-webrtc-client-react-native/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-20 | ✗→✓ | ▲ Improved | 57% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 23% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 82% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 36% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 37% | 0% |
Build real-time voice communication into React Native apps (Android & iOS) using the @telnyx/react-voice-commons-sdk library.
> Prerequisites: Create WebRTC credentials and generate a login token using the Telnyx server-side SDK. See the telnyx-webrtc-* skill in your server language plugin (e.g., telnyx-python, telnyx-javascript).
bashnpm install @telnyx/react-voice-commons-sdk
tsximport { TelnyxVoiceApp, createTelnyxVoipClient } from '@telnyx/react-voice-commons-sdk'; // Create VoIP client instance const voipClient = createTelnyxVoipClient({ enableAppStateManagement: true, // Auto background/foreground handling debug: true, // Enable logging }); export default function App() { return ( <TelnyxVoiceApp voipClient={voipClient} enableAutoReconnect={false} debug={true} > <YourAppContent /> </TelnyxVoiceApp> ); }
tsximport { createCredentialConfig } from '@telnyx/react-voice-commons-sdk'; const config = createCredentialConfig('sip_username', 'sip_password', { debug: true, pushNotificationDeviceToken: 'your_device_token', }); await voipClient.login(config);
tsximport { createTokenConfig } from '@telnyx/react-voice-commons-sdk'; const config = createTokenConfig('your_jwt_token', { debug: true, pushNotificationDeviceToken: 'your_device_token', }); await voipClient.loginWithToken(config);
The library automatically stores credentials for seamless reconnection:
tsx// Automatically reconnects using stored credentials const success = await voipClient.loginFromStoredConfig(); if (!success) { // No stored auth, show login UI }
tsximport { useEffect, useState } from 'react'; function CallScreen() { const [connectionState, setConnectionState] = useState(null); const [calls, setCalls] = useState([]); useEffect(() => { // Subscribe to connection state const connSub = voipClient.connectionState$.subscribe((state) => { setConnectionState(state); }); // Subscribe to active calls const callsSub = voipClient.calls$.subscribe((activeCalls) => { setCalls(activeCalls); }); return () => { connSub.unsubscribe(); callsSub.unsubscribe(); }; }, []); return (/* UI */); }
tsxuseEffect(() => { if (call) { const sub = call.callState$.subscribe((state) => { console.log('Call state:', state); }); return () => sub.unsubscribe(); } }, [call]);
tsxconst call = await voipClient.newCall('+18004377950');
Incoming calls are handled automatically via push notifications and the TelnyxVoiceApp wrapper. The native call UI (CallKit/ConnectionService) is displayed automatically.
tsx// Answer incoming call await call.answer(); // Mute/Unmute await call.mute(); await call.unmute(); // Hold/Unhold await call.hold(); await call.unhold(); // End call await call.hangup(); // Send DTMF await call.dtmf('1');
google-services.json in project rootkotlin// MainActivity.kt import com.telnyx.react_voice_commons.TelnyxMainActivity class MainActivity : TelnyxMainActivity() { override fun onHandleIntent(intent: Intent) { super.onHandleIntent(intent) // Additional intent processing } }
tsx// index.js or App.tsx import messaging from '@react-native-firebase/messaging'; import { TelnyxVoiceApp } from '@telnyx/react-voice-commons-sdk'; messaging().setBackgroundMessageHandler(async (remoteMessage) => { await TelnyxVoiceApp.handleBackgroundPush(remoteMessage.data); });
swift// AppDelegate.swift import PushKit import TelnyxVoiceCommons @UIApplicationMain public class AppDelegate: ExpoAppDelegate, PKPushRegistryDelegate { public override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil ) -> Bool { // Initialize VoIP push registration TelnyxVoipPushHandler.initializeVoipRegistration() return super.application(application, didFinishLaunchingWithOptions: launchOptions) } // VoIP Push Token Update public func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) { TelnyxVoipPushHandler.shared.handleVoipTokenUpdate(pushCredentials, type: type) } // VoIP Push Received public func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) { TelnyxVoipPushHandler.shared.handleVoipPush(payload, type: type, completion: completion) } }
> Note: CallKit integration is automatically handled by the internal CallBridge component.
| Option | Type | Default | Description | |--------|------|---------|-------------| | enableAppStateManagement | boolean | true | Auto background/foreground handling | | debug | boolean | false | Enable debug logging |
| Prop | Type | Description | |------|------|-------------| | voipClient | TelnyxVoipClient | The VoIP client instance | | enableAutoReconnect | boolean | Auto-reconnect on disconnect | | debug | boolean | Enable debug logging |
The library manages these AsyncStorage keys internally:
@telnyx_username - SIP username@telnyx_password - SIP password@credential_token - JWT token@push_token - Push notification token> You don't need to manage these manually.
| Issue | Solution | |-------|----------| | Double login | Don't call login() manually when using TelnyxVoiceApp with auto-reconnect | | Background disconnect | Check enableAutoReconnect setting | | Android push not working | Verify google-services.json and MainActivity extends TelnyxMainActivity | | iOS push not working | Ensure AppDelegate implements PKPushRegistryDelegate and calls TelnyxVoipPushHandler | | Memory leaks | Unsubscribe from RxJS observables in useEffect cleanup | | Audio issues | iOS audio handled by CallBridge; Android check ConnectionService |
tsximport AsyncStorage from '@react-native-async-storage/async-storage'; await AsyncStorage.multiRemove([ '@telnyx_username', '@telnyx_password', '@credential_token', '@push_token', ]);
<!-- BEGIN AUTO-GENERATED API REFERENCE -- do not edit below this line -->
references/webrtc-server-api.md has the server-side WebRTC API — credential creation, token generation, and push notification setup. You MUST read it when setting up authentication or push notifications.
The main public interface for the react-voice-commons module.
This class serves as the Façade for the entire module, providing a simplified API that completely hides the underlying complexity. It is the sole entry point for developers using the react-voice-commons package.
The TelnyxVoipClient is designed to be state-management agnostic, exposing all observable state via RxJS streams. This allows developers to integrate it into their chosen state management solution naturally.
> login(config): Promise\<void\>
CredentialConfig
A Promise that completes when the connection attempt is initiated
> loginWithToken(config): Promise\<void\>
TokenConfig
A Promise that completes when the connection attempt is initiated
> logout(): Promise\<void\>
> loginFromStoredConfig(): Promise\<boolean\>
> newCall(destination, callerName?, callerNumber?, customHeaders?): Promise\<Call\>
The destination number or SIP URI to call
Optional caller name to display
Optional caller ID number
Optional custom headers to include with the call
A Promise that completes with the Call object once the invitation has been sent
> handlePushNotification(payload): Promise\<void\>
The push notification payload
> disablePushNotifications(): void
> setCallConnecting(callId): void
The ID of the call to set to connecting state
> findCallByTelnyxCall(telnyxCall): Call
The Telnyx call object to find
Call
> queueAnswerFromCallKit(customHeaders): void
Optional custom headers to include with the answer
> queueEndFromCallKit(): void
> dispose(): void
Represents a call with reactive state streams.
This class wraps the underlying Telnyx Call object and provides reactive streams for all call state changes, making it easy to integrate with any state management solution.
> answer(customHeaders?): Promise\<void\>
Optional custom headers to include with the answer
> hangup(customHeaders?): Promise\<void\>
Optional custom headers to include with the hangup request
> hold(): Promise\<void\>
> resume(): Promise\<void\>
> mute(): Promise\<void\>
> unmute(): Promise\<void\>
> toggleMute(): Promise\<void\>
> setConnecting(): void
> dispose(): void
Represents the state of a call in the Telnyx system.
This enum provides a simplified view of call states, abstracting away the complexity of the underlying SIP call states.
> RINGING: "RINGING"
> CONNECTING: "CONNECTING"
> ACTIVE: "ACTIVE"
> HELD: "HELD"
> ENDED: "ENDED"
> FAILED: "FAILED"
> DROPPED: "DROPPED"
Represents the connection state to the Telnyx platform.
This enum provides a simplified view of the connection status, abstracting away the complexity of the underlying WebSocket states.
> DISCONNECTED: "DISCONNECTED"
> CONNECTING: "CONNECTING"
> CONNECTED: "CONNECTED"
> RECONNECTING: "RECONNECTING"
> ERROR: "ERROR"
<!-- END AUTO-GENERATED API REFERENCE -->
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-20 | fail→pass | 15,301 | 6,081 | -60% | 1 | 1 | 0% | 2,889 | 4,548 | +57% | 0 | 0 | — |
case-01 | fail→pass | 19,876 | 12,020 | -40% | 1 | 1 | 0% | 3,733 | 4,586 | +23% | 0 | 0 | — |
case-02 | fail→pass | 19,529 | 19,724 | +1% | 1 | 1 | 0% | 4,429 | 8,080 | +82% | 0 | 0 | — |
case-03 | fail→pass | 17,727 | 7,636 | -57% | 1 | 1 | 0% | 3,508 | 4,756 | +36% | 0 | 0 | — |
case-04 | pass→pass | 12,682 | 7,712 | -39% | 1 | 1 | 0% | 2,489 | 4,855 | +95% | 0 | 0 | — |
case-05 | pass→pass | 12,107 | 7,219 | -40% | 1 | 1 | 0% | 2,366 | 4,809 | +103% | 0 | 0 | — |
case-06 | pass→pass | 12,379 | 9,469 | -24% | 1 | 1 | 0% | 2,557 | 5,310 | +108% | 0 | 0 | — |
case-07 | fail→pass | 15,060 | 3,547 | -76% | 1 | 1 | 0% | 2,844 | 3,888 | +37% | 0 | 0 | — |
case-08 | fail→pass | 15,983 | 2,678 | -83% | 1 | 1 | 0% | 2,981 | 3,829 | +28% | 0 | 0 | — |
case-09 | fail→pass | 13,748 | 4,046 | -71% | 1 | 1 | 0% | 2,567 | 3,990 | +55% | 0 | 0 | — |
case-10 | fail→pass | 14,270 | 4,517 | -68% | 1 | 1 | 0% | 2,593 | 4,167 | +61% | 0 | 0 | — |
case-11 | fail→pass | 12,763 | 3,508 | -73% | 1 | 1 | 0% | 2,321 | 3,939 | +70% | 0 | 0 | — |
case-12 | fail→pass | 10,959 | 2,238 | -80% | 1 | 1 | 0% | 1,884 | 3,657 | +94% | 0 | 0 | — |
case-13 | fail→pass | 8,497 | 5,613 | -34% | 1 | 1 | 0% | 1,680 | 4,452 | +165% | 0 | 0 | — |
case-14 | fail→pass | 13,272 | 5,095 | -62% | 1 | 1 | 0% | 2,551 | 4,237 | +66% | 0 | 0 | — |
case-15 | fail→pass | 10,870 | 2,341 | -78% | 1 | 1 | 0% | 1,984 | 3,702 | +87% | 0 | 0 | — |
case-16 | pass→pass | 4,765 | 1,626 | -66% | 1 | 1 | 0% | 790 | 3,487 | +341% | 0 | 0 | — |
case-17 | fail→pass | 11,437 | 1,896 | -83% | 1 | 1 | 0% | 2,134 | 3,541 | +66% | 0 | 0 | — |
case-18 | fail→pass | 12,228 | 3,467 | -72% | 1 | 1 | 0% | 2,016 | 3,919 | +94% | 0 | 0 | — |
case-19 | fail→pass | 12,568 | 3,685 | -71% | 1 | 1 | 0% | 2,573 | 3,977 | +55% | 0 | 0 | — |
case-21 | pass→pass | 8,080 | 2,034 | -75% | 1 | 1 | 0% | 1,521 | 3,618 | +138% | 0 | 0 | — |
case-22 | pass→pass | 7,962 | 1,558 | -80% | 1 | 1 | 0% | 1,404 | 3,433 | +145% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +73 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.