Token导航 LogoToken导航TokenDH.com
前端设计敏感数据github未标认证来源可访问许可证需确认审计通过

telnyx-webrtc-client-react-nativetelnyx webrtc client React native 前端

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

196

周安装

8

GitHub Stars

167

下载量

63
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:telnyx-webrtc-client-react-native(telnyx webrtc client React native 前端)
来源仓库:https://github.com/team-telnyx/telnyx-skills
仓库路径:skills/telnyx-webrtc-client-react-native
安装命令:
npx skills add https://github.com/team-telnyx/telnyx-skills --skill telnyx-webrtc-client-react-native
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/team-telnyx/telnyx-skills --skill telnyx-webrtc-client-react-native

简介

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。

  • 适合生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构或定位布局问题。
  • 通过 GitHub 安装,支持 Codex、Claude、Cursor、Gemini CLI 等宿主环境。
  • 使用时应结合项目现有设计系统、路由和构建方式,避免生成孤立片段;涉及页面改动需配合本地预览确认效果。
  • 安装前建议核实权限与维护状态,防止误改关键资源。

SKILL.md

Telnyx WebRTC - React Native SDK

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).

Features

  • Reactive Streams: RxJS-based state management
  • Automatic Lifecycle: Background/foreground handling
  • Native Call UI: CallKit (iOS) and ConnectionService (Android)
  • Push Notifications: FCM (Android) and APNs/PushKit (iOS)
  • TypeScript Support: Full type definitions

Installation

npm install @telnyx/react-voice-commons-sdk

Basic Setup

import { 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>
  );
}

Authentication

Credential-Based Login

import { createCredentialConfig } from '@telnyx/react-voice-commons-sdk';

const config = createCredentialConfig('sip_username', 'sip_password', {
  debug: true,
  pushNotificationDeviceToken: 'your_device_token',
});

await voipClient.login(config);

Token-Based Login (JWT)

import { createTokenConfig } from '@telnyx/react-voice-commons-sdk';

const config = createTokenConfig('your_jwt_token', {
  debug: true,
  pushNotificationDeviceToken: 'your_device_token',
});

await voipClient.loginWithToken(config);

Auto-Reconnection

The library automatically stores credentials for seamless reconnection:

// Automatically reconnects using stored credentials
const success = await voipClient.loginFromStoredConfig();

if (!success) {
  // No stored auth, show login UI
}

Reactive State Management

import { 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 */);
}

Individual Call State

useEffect(() => {
  if (call) {
    const sub = call.callState$.subscribe((state) => {
      console.log('Call state:', state);
    });
    return () => sub.unsubscribe();
  }
}, [call]);

Making Calls

const call = await voipClient.newCall('+18004377950');

Receiving Calls

Incoming calls are handled automatically via push notifications and the TelnyxVoiceApp wrapper. The native call UI (CallKit/ConnectionService) is displayed automatically.


Call Controls

// 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');

Push Notifications - Android (FCM)

1. Place google-services.json in project root

2. MainActivity Setup

// MainActivity.kt
import com.telnyx.react_voice_commons.TelnyxMainActivity

class MainActivity : TelnyxMainActivity() {
    override fun onHandleIntent(intent: Intent) {
        super.onHandleIntent(intent)
        // Additional intent processing
    }
}

3. Background Message Handler

// 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);
});

Push Notifications - iOS (PushKit)

AppDelegate Setup

// 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.

Configuration Options

createTelnyxVoipClient Options

OptionTypeDefaultDescription
enableAppStateManagementbooleantrueAuto background/foreground handling
debugbooleanfalseEnable debug logging

TelnyxVoiceApp Props

PropTypeDescription
voipClientTelnyxVoipClientThe VoIP client instance
enableAutoReconnectbooleanAuto-reconnect on disconnect
debugbooleanEnable debug logging

Storage Keys (Managed Automatically)

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.

Troubleshooting

IssueSolution
Double loginDon't call login() manually when using TelnyxVoiceApp with auto-reconnect
Background disconnectCheck enableAutoReconnect setting
Android push not workingVerify google-services.json and MainActivity extends TelnyxMainActivity
iOS push not workingEnsure AppDelegate implements PKPushRegistryDelegate and calls TelnyxVoipPushHandler
Memory leaksUnsubscribe from RxJS observables in useEffect cleanup
Audio issuesiOS audio handled by CallBridge; Android check ConnectionService

Clear Stored Auth (Advanced)

import AsyncStorage from '@react-native-async-storage/async-storage';

await AsyncStorage.multiRemove([
  '@telnyx_username',
  '@telnyx_password',
  '@credential_token',
  '@push_token',
]);

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.

API Reference

TelnyxVoipClient

Class: TelnyxVoipClient

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.

Methods

login()

login(config): Promise<void>

Parameters

config

CredentialConfig

Returns

A Promise that completes when the connection attempt is initiated

loginWithToken()

loginWithToken(config): Promise<void>

Parameters

config

TokenConfig

Returns

A Promise that completes when the connection attempt is initiated

logout()

logout(): Promise<void>

Returns

loginFromStoredConfig()

loginFromStoredConfig(): Promise<boolean>

Returns

newCall()

newCall(destination, callerName?, callerNumber?, customHeaders?): Promise<Call>

Parameters

destination

The destination number or SIP URI to call

callerName?

Optional caller name to display

callerNumber?

Optional caller ID number

customHeaders?

Optional custom headers to include with the call

Returns

A Promise that completes with the Call object once the invitation has been sent

handlePushNotification()

handlePushNotification(payload): Promise<void>

Parameters

payload

The push notification payload

Returns

disablePushNotifications()

disablePushNotifications(): void

Returns

setCallConnecting()

setCallConnecting(callId): void

Parameters

callId

The ID of the call to set to connecting state

Returns

findCallByTelnyxCall()

findCallByTelnyxCall(telnyxCall): Call

Parameters

telnyxCall

The Telnyx call object to find

Returns

Call

queueAnswerFromCallKit()

queueAnswerFromCallKit(customHeaders): void

Parameters

customHeaders

Optional custom headers to include with the answer

Returns

queueEndFromCallKit()

queueEndFromCallKit(): void

Returns

dispose()

dispose(): void

Returns

Call

Class: Call

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.

Methods

answer()

answer(customHeaders?): Promise<void>

Parameters

customHeaders?

Optional custom headers to include with the answer

Returns

hangup()

hangup(customHeaders?): Promise<void>

Parameters

customHeaders?

Optional custom headers to include with the hangup request

Returns

hold()

hold(): Promise<void>

Returns

resume()

resume(): Promise<void>

Returns

mute()

mute(): Promise<void>

Returns

unmute()

unmute(): Promise<void>

Returns

toggleMute()

toggleMute(): Promise<void>

Returns

setConnecting()

setConnecting(): void

Returns

dispose()

dispose(): void

Returns

TelnyxCallState

Enumeration: TelnyxCallState

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.

Enumeration Members

RINGING

RINGING: "RINGING"

CONNECTING

CONNECTING: "CONNECTING"

ACTIVE

ACTIVE: "ACTIVE"

HELD

HELD: "HELD"

ENDED

ENDED: "ENDED"

FAILED

FAILED: "FAILED"

DROPPED

DROPPED: "DROPPED"

TelnyxConnectionState

Enumeration: TelnyxConnectionState

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.

Enumeration Members

DISCONNECTED

DISCONNECTED: "DISCONNECTED"

CONNECTING

CONNECTING: "CONNECTING"

CONNECTED

CONNECTED: "CONNECTED"

RECONNECTING

RECONNECTING: "RECONNECTING"

ERROR

ERROR: "ERROR"

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.12%
按下载量换算21

Claude

33.01%
按下载量换算21

Cursor

17.61%
按下载量换算11

Gemini CLI

9.75%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills