api/javascript/telnyx-networking-javascript/SKILL.md
Configure private networks, WireGuard VPN gateways, internet gateways, and virtual cross connects. This skill provides JavaScript SDK examples.
npx skillsauth add team-telnyx/telnyx-toolkit telnyx-networking-javascriptInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
npm install telnyx
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
All examples below assume client is already initialized as shown above.
List all regions and the interfaces that region supports
GET /regions
const regions = await client.regions.list();
console.log(regions.data);
List all Networks.
GET /networks
// Automatically fetches more pages as needed.
for await (const networkListResponse of client.networks.list()) {
console.log(networkListResponse);
}
Create a new Network.
POST /networks
const network = await client.networks.create({ name: 'test network' });
console.log(network.data);
Retrieve a Network.
GET /networks/{id}
const network = await client.networks.retrieve('6a09cdc3-8948-47f0-aa62-74ac943d6c58');
console.log(network.data);
Update a Network.
PATCH /networks/{id}
const network = await client.networks.update('6a09cdc3-8948-47f0-aa62-74ac943d6c58', {
name: 'test network',
});
console.log(network.data);
Delete a Network.
DELETE /networks/{id}
const network = await client.networks.delete('6a09cdc3-8948-47f0-aa62-74ac943d6c58');
console.log(network.data);
GET /networks/{id}/default_gateway
const defaultGateway = await client.networks.defaultGateway.retrieve(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(defaultGateway.data);
POST /networks/{id}/default_gateway
const defaultGateway = await client.networks.defaultGateway.create(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(defaultGateway.data);
DELETE /networks/{id}/default_gateway
const defaultGateway = await client.networks.defaultGateway.delete(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(defaultGateway.data);
GET /networks/{id}/network_interfaces
// Automatically fetches more pages as needed.
for await (const networkListInterfacesResponse of client.networks.listInterfaces(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
)) {
console.log(networkListInterfacesResponse);
}
List all WireGuard Interfaces.
GET /wireguard_interfaces
// Automatically fetches more pages as needed.
for await (const wireguardInterfaceListResponse of client.wireguardInterfaces.list()) {
console.log(wireguardInterfaceListResponse);
}
Create a new WireGuard Interface.
POST /wireguard_interfaces
const wireguardInterface = await client.wireguardInterfaces.create({ region_code: 'ashburn-va' });
console.log(wireguardInterface.data);
Retrieve a WireGuard Interfaces.
GET /wireguard_interfaces/{id}
const wireguardInterface = await client.wireguardInterfaces.retrieve(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(wireguardInterface.data);
Delete a WireGuard Interface.
DELETE /wireguard_interfaces/{id}
const wireguardInterface = await client.wireguardInterfaces.delete(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(wireguardInterface.data);
List all WireGuard peers.
GET /wireguard_peers
// Automatically fetches more pages as needed.
for await (const wireguardPeerListResponse of client.wireguardPeers.list()) {
console.log(wireguardPeerListResponse);
}
Create a new WireGuard Peer.
POST /wireguard_peers
const wireguardPeer = await client.wireguardPeers.create({
wireguard_interface_id: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
});
console.log(wireguardPeer.data);
Retrieve the WireGuard peer.
GET /wireguard_peers/{id}
const wireguardPeer = await client.wireguardPeers.retrieve('6a09cdc3-8948-47f0-aa62-74ac943d6c58');
console.log(wireguardPeer.data);
Update the WireGuard peer.
PATCH /wireguard_peers/{id}
const wireguardPeer = await client.wireguardPeers.update('6a09cdc3-8948-47f0-aa62-74ac943d6c58');
console.log(wireguardPeer.data);
Delete the WireGuard peer.
DELETE /wireguard_peers/{id}
const wireguardPeer = await client.wireguardPeers.delete('6a09cdc3-8948-47f0-aa62-74ac943d6c58');
console.log(wireguardPeer.data);
GET /wireguard_peers/{id}/config
const response = await client.wireguardPeers.retrieveConfig('6a09cdc3-8948-47f0-aa62-74ac943d6c58');
console.log(response);
Get all Private Wireless Gateways belonging to the user.
GET /private_wireless_gateways
// Automatically fetches more pages as needed.
for await (const privateWirelessGateway of client.privateWirelessGateways.list()) {
console.log(privateWirelessGateway.id);
}
Asynchronously create a Private Wireless Gateway for SIM cards for a previously created network.
POST /private_wireless_gateways — Required: network_id, name
const privateWirelessGateway = await client.privateWirelessGateways.create({
name: 'My private wireless gateway',
network_id: '6a09cdc3-8948-47f0-aa62-74ac943d6c58',
});
console.log(privateWirelessGateway.data);
Retrieve information about a Private Wireless Gateway.
GET /private_wireless_gateways/{id}
const privateWirelessGateway = await client.privateWirelessGateways.retrieve(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(privateWirelessGateway.data);
Deletes the Private Wireless Gateway.
DELETE /private_wireless_gateways/{id}
const privateWirelessGateway = await client.privateWirelessGateways.delete(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(privateWirelessGateway.data);
List all Public Internet Gateways.
GET /public_internet_gateways
// Automatically fetches more pages as needed.
for await (const publicInternetGatewayListResponse of client.publicInternetGateways.list()) {
console.log(publicInternetGatewayListResponse);
}
Create a new Public Internet Gateway.
POST /public_internet_gateways
const publicInternetGateway = await client.publicInternetGateways.create();
console.log(publicInternetGateway.data);
Retrieve a Public Internet Gateway.
GET /public_internet_gateways/{id}
const publicInternetGateway = await client.publicInternetGateways.retrieve(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(publicInternetGateway.data);
Delete a Public Internet Gateway.
DELETE /public_internet_gateways/{id}
const publicInternetGateway = await client.publicInternetGateways.delete(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(publicInternetGateway.data);
List all Virtual Cross Connects.
GET /virtual_cross_connects
// Automatically fetches more pages as needed.
for await (const virtualCrossConnectListResponse of client.virtualCrossConnects.list()) {
console.log(virtualCrossConnectListResponse);
}
Create a new Virtual Cross Connect.<br /><br />For AWS and GCE, you have the option of creating the primary connection first and the secondary connection later.
POST /virtual_cross_connects
const virtualCrossConnect = await client.virtualCrossConnects.create({ region_code: 'ashburn-va' });
console.log(virtualCrossConnect.data);
Retrieve a Virtual Cross Connect.
GET /virtual_cross_connects/{id}
const virtualCrossConnect = await client.virtualCrossConnects.retrieve(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(virtualCrossConnect.data);
Update the Virtual Cross Connect.<br /><br />Cloud IPs can only be patched during the created state, as GCE will only inform you of your generated IP once the pending connection requested has bee...
PATCH /virtual_cross_connects/{id}
const virtualCrossConnect = await client.virtualCrossConnects.update(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(virtualCrossConnect.data);
Delete a Virtual Cross Connect.
DELETE /virtual_cross_connects/{id}
const virtualCrossConnect = await client.virtualCrossConnects.delete(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(virtualCrossConnect.data);
List Virtual Cross Connects Cloud Coverage.<br /><br />This endpoint shows which cloud regions are available for the location_code your Virtual Cross Connect will be provisioned in.
GET /virtual_cross_connects/coverage
// Automatically fetches more pages as needed.
for await (const virtualCrossConnectsCoverageListResponse of client.virtualCrossConnectsCoverage.list()) {
console.log(virtualCrossConnectsCoverageListResponse.available_bandwidth);
}
List all Global IPs.
GET /global_ips
// Automatically fetches more pages as needed.
for await (const globalIPListResponse of client.globalIPs.list()) {
console.log(globalIPListResponse);
}
Create a Global IP.
POST /global_ips
const globalIP = await client.globalIPs.create();
console.log(globalIP.data);
Retrieve a Global IP.
GET /global_ips/{id}
const globalIP = await client.globalIPs.retrieve('6a09cdc3-8948-47f0-aa62-74ac943d6c58');
console.log(globalIP.data);
Delete a Global IP.
DELETE /global_ips/{id}
const globalIP = await client.globalIPs.delete('6a09cdc3-8948-47f0-aa62-74ac943d6c58');
console.log(globalIP.data);
GET /global_ip_allowed_ports
const globalIPAllowedPorts = await client.globalIPAllowedPorts.list();
console.log(globalIPAllowedPorts.data);
GET /global_ip_assignment_health
const globalIPAssignmentHealth = await client.globalIPAssignmentHealth.retrieve();
console.log(globalIPAssignmentHealth.data);
List all Global IP assignments.
GET /global_ip_assignments
// Automatically fetches more pages as needed.
for await (const globalIPAssignment of client.globalIPAssignments.list()) {
console.log(globalIPAssignment.id);
}
Create a Global IP assignment.
POST /global_ip_assignments
const globalIPAssignment = await client.globalIPAssignments.create();
console.log(globalIPAssignment.data);
Retrieve a Global IP assignment.
GET /global_ip_assignments/{id}
const globalIPAssignment = await client.globalIPAssignments.retrieve(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(globalIPAssignment.data);
Update a Global IP assignment.
PATCH /global_ip_assignments/{id}
const globalIPAssignment = await client.globalIPAssignments.update(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
{ globalIpAssignmentUpdateRequest: {} },
);
console.log(globalIPAssignment.data);
Delete a Global IP assignment.
DELETE /global_ip_assignments/{id}
const globalIPAssignment = await client.globalIPAssignments.delete(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(globalIPAssignment.data);
GET /global_ip_assignments/usage
const globalIPAssignmentsUsage = await client.globalIPAssignmentsUsage.retrieve();
console.log(globalIPAssignmentsUsage.data);
List all Global IP Health check types.
GET /global_ip_health_check_types
const globalIPHealthCheckTypes = await client.globalIPHealthCheckTypes.list();
console.log(globalIPHealthCheckTypes.data);
List all Global IP health checks.
GET /global_ip_health_checks
// Automatically fetches more pages as needed.
for await (const globalIPHealthCheckListResponse of client.globalIPHealthChecks.list()) {
console.log(globalIPHealthCheckListResponse);
}
Create a Global IP health check.
POST /global_ip_health_checks
const globalIPHealthCheck = await client.globalIPHealthChecks.create();
console.log(globalIPHealthCheck.data);
Retrieve a Global IP health check.
GET /global_ip_health_checks/{id}
const globalIPHealthCheck = await client.globalIPHealthChecks.retrieve(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(globalIPHealthCheck.data);
Delete a Global IP health check.
DELETE /global_ip_health_checks/{id}
const globalIPHealthCheck = await client.globalIPHealthChecks.delete(
'6a09cdc3-8948-47f0-aa62-74ac943d6c58',
);
console.log(globalIPHealthCheck.data);
GET /global_ip_latency
const globalIPLatency = await client.globalIPLatency.retrieve();
console.log(globalIPLatency.data);
GET /global_ip_protocols
const globalIPProtocols = await client.globalIPProtocols.list();
console.log(globalIPProtocols.data);
GET /global_ip_usage
const globalIPUsage = await client.globalIPUsage.retrieve();
console.log(globalIPUsage.data);
tools
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.
tools
Build browser-based VoIP calling apps using Telnyx WebRTC JavaScript SDK. Covers authentication, voice calls, events, debugging, call quality metrics, and AI Agent integration. Use for web-based real-time communication.
tools
Build VoIP calling apps on iOS using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, CallKit integration, PushKit/APNS push notifications, call quality metrics, and AI Agent integration. Use when implementing real-time voice communication on iOS.
tools
Build cross-platform VoIP calling apps with Flutter using Telnyx WebRTC SDK. Covers authentication, making/receiving calls, push notifications (FCM + APNS), call quality metrics, and AI Agent integration. Works on Android, iOS, and Web.