SignalWire Docs
- Voice APIs that outperform the competition at lower cost
- High-throughput Messaging backed by unmatched support to stay compliant and maximize delivery rates
- Integrated ultra low-latency AI for human-like interaction
- Build with compatible REST APIs or next-generation WebSocket realtime APIs
- Robust Chat, Fax, and Video APIs and SDKs
Products
Voice
High-performance realtime and compatible APIs
Messaging
Programmable, high- throughput, compliant SMS & MMS
Video
Fully customizable audio/video conferencing apps
Chat
Implement seamless in-browser chat using PubSub
Fax
Programmable fax, certified SOC 2 Type II and HIPAA compliant
SWML
Powerful, lightweight, server-optional voice application scripts
AI
Integrated, powerful, scalable AI agents for your application
Call Flow Builder
Build drag-and-drop calling apps without code
Try it out
- Relay Realtime SDK (Server)
- Relay Browser SDK
Relay Realtime SDK (Server)
import { SignalWire } from "@signalwire/realtime-api";
// Initialize the SignalWire client
const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" });
// Access video client from the main client
const videoClient = client.video;
// Setup listener for when a room starts
await videoClient.listen({
onRoomStarted: async (roomSession) => {
console.log("Room started", roomSession.displayName);
roomSession.startStream({
url: "rtmp://example.com/stream"
})
}
});
Relay Browser SDK
import * as SignalWire from "@signalwire/js";
import axios from "axios";
const rtmpUrl = "rtmp://example.com/live";
async function connect() {
try {
await navigator.mediaDevices.getUserMedia({
video: true,
audio: true
});
} catch (e) {
console.error("Failed to get user media:", e);
return;
}
const reply = await axios.post(
"/get_token", // Make request to server to get video token from SignalWire Rest API
{
user_name: "user",
room_name: "room"
}
)
const roomSession = new SignalWire.Video.RoomSession({
token: reply.data.token, // Obtained from SignalWire REST API
rootElement: document.getElementById("video")
})
roomSession.on("stream.started", (m) => console.log(m));
try {
await roomSession.join()
await roomSession.startStream({ url: rtmpUrl })
} catch (e) {
console.error("Failed to join room:", e);
}
}
connect()
- SWML
- Call Flow Builder
SWML
version: 1.0.0
sections:
main:
- ai:
post_prompt_url: https://example.com/my-post-prompt-url
params:
save_conversation: true
prompt:
text: |
You are a knowledgeable developer.
Have an open-ended discussion with the caller about SignalWire and programmable communications.
Call Flow Builder
- SWML
- Call Flow Builder
- Relay Realtime SDK (Server)
- CXML
SWML
version: 1.0.0
sections:
main:
- play:
url: 'say: Hello from SignalWire!'
Call Flow Builder
Relay Realtime SDK (Server)
import { SignalWire } from "@signalwire/realtime-api";
const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" })
const voiceClient = client.voice;
// Listen for incoming calls
await voiceClient.listen({
topics: ["office"],
onCallReceived: async (call) => {
console.log("Call received");
// Answer the call
call.answer();
// Play TTS on the call
await call.playTTS({
text: "Hello from SignalWire!",
}
})
}
});
CXML
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Hello from SignalWire!</Say>
</Response>
- SWML
- Relay Realtime SDK (Server)
- CXML
- REST API
SWML
version: 1.0.0
sections:
main:
- send_sms:
from_number: "+155512312345"
to_number: "+15555554321"
body: "Hello from SignalWire!"
Relay Realtime SDK (Server)
import { SignalWire } from "@signalwire/realtime-api";
const client = await SignalWire({ project: "ProjectID Here", token: "Token Here"})
let messageClient = client.messaging;
const sendResult = await messageClient.send({
from: "+155512312345",
to: "+15555554321",
body: "Hello from SignalWire!"
});
CXML
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Message>
<Body>Hello from SignalWire!</Body>
</Message>
</Response>
REST API
curl -L 'https://<YOUR_SPACE>.signalwire.com/api/laml/2010-04-01/Accounts/<PROJECT_ID_HERE>/Messages' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Basic <BASE64 ENCODED AUTHENTICATION STRING>' \
-d 'To=%2B155512312345' \
-d 'From=%2B15555554321' \
-d 'Body=Hello%20from%20SignalWire!'
- SWML
- CXML
SWML
version: 1.0.0
sections:
main:
- receive_fax: {}
CXML
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Receive></Receive>
</Response>
- Relay Realtime SDK (Server)
- Relay Browser SDK
Relay Realtime SDK (Server)
import { SignalWire } from "@signalwire/realtime-api";
const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" })
const chatClient = client.chat;
await chatClient.listen({
channels: ["channel1"],
onMessageReceived: async (message) => {
console.log(message.content);
}
});
await chatClient.publish({
channel: "channel1",
content: `Hello from SignalWire!`
})
Relay Browser SDK
import { Chat } from "@signalwire/js";
const chatClient = new Chat.Client({
token: "<your_chat_token>", // get this from the REST APIs
});
await chatClient.subscribe(["mychannel1", "mychannel2"]);
chatClient.on("message", (message) => {
console.log("Received", message.content,
"on", message.channel,
"at", message.publishedAt);
});
await chatClient.publish({
channel: "mychannel1",
content: `Hello from SignalWire!`,
});
- Relay Realtime SDK (Server)
- Relay Browser SDK
Relay Realtime SDK (Server)
import { SignalWire } from '@signalwire/realtime-api'
const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" })
const pubSubClient = client.pubSub;
await pubSubClient.listen({
channels: ["mychannel1"],
onMessageReceived: (message) => {
console.log(message);
}
});
await pubSubClient.publish({
channel: "mychannel1",
content: "Hello from SignalWire!"
});
Relay Browser SDK
import { PubSub } from "@signalwire/js";
const pubSubClient = new PubSub.Client({
token: "<your chat token>", // get this from the REST APIs
});
await pubSubClient.subscribe(["mychannel1", "mychannel2"]);
pubSubClient.on("message", (message) => {
console.log("Received", message.content,
"on", message.channel,
"at", message.publishedAt);
});
await pubSubClient.publish({
channel: "mychannel1",
content: "Hello from SignalWire!",
});
- Relay Realtime SDK (Server)
- Relay Browser SDK
Relay Realtime SDK (Server)
import { SignalWire } from "@signalwire/realtime-api";
// Initialize the SignalWire client
const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" });
// Access video client from the main client
const videoClient = client.video;
// Setup listener for when a room starts
await videoClient.listen({
onRoomStarted: async (roomSession) => {
console.log("Room started", roomSession.displayName);
roomSession.startStream({
url: "rtmp://example.com/stream"
})
}
});
Relay Browser SDK
import * as SignalWire from "@signalwire/js";
import axios from "axios";
const rtmpUrl = "rtmp://example.com/live";
async function connect() {
try {
await navigator.mediaDevices.getUserMedia({
video: true,
audio: true
});
} catch (e) {
console.error("Failed to get user media:", e);
return;
}
const reply = await axios.post(
"/get_token", // Make request to server to get video token from SignalWire Rest API
{
user_name: "user",
room_name: "room"
}
)
const roomSession = new SignalWire.Video.RoomSession({
token: reply.data.token, // Obtained from SignalWire REST API
rootElement: document.getElementById("video")
})
roomSession.on("stream.started", (m) => console.log(m));
try {
await roomSession.join()
await roomSession.startStream({ url: rtmpUrl })
} catch (e) {
console.error("Failed to join room:", e);
}
}
connect()
- SWML
- Call Flow Builder
SWML
version: 1.0.0
sections:
main:
- ai:
post_prompt_url: https://example.com/my-post-prompt-url
params:
save_conversation: true
prompt:
text: |
You are a knowledgeable developer.
Have an open-ended discussion with the caller about SignalWire and programmable communications.
Call Flow Builder
- SWML
- Call Flow Builder
- Relay Realtime SDK (Server)
- CXML
SWML
version: 1.0.0
sections:
main:
- play:
url: 'say: Hello from SignalWire!'
Call Flow Builder
Relay Realtime SDK (Server)
import { SignalWire } from "@signalwire/realtime-api";
const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" })
const voiceClient = client.voice;
// Listen for incoming calls
await voiceClient.listen({
topics: ["office"],
onCallReceived: async (call) => {
console.log("Call received");
// Answer the call
call.answer();
// Play TTS on the call
await call.playTTS({
text: "Hello from SignalWire!",
}
})
}
});
CXML
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Say>Hello from SignalWire!</Say>
</Response>
- SWML
- Relay Realtime SDK (Server)
- CXML
- REST API
SWML
version: 1.0.0
sections:
main:
- send_sms:
from_number: "+155512312345"
to_number: "+15555554321"
body: "Hello from SignalWire!"
Relay Realtime SDK (Server)
import { SignalWire } from "@signalwire/realtime-api";
const client = await SignalWire({ project: "ProjectID Here", token: "Token Here"})
let messageClient = client.messaging;
const sendResult = await messageClient.send({
from: "+155512312345",
to: "+15555554321",
body: "Hello from SignalWire!"
});
CXML
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Message>
<Body>Hello from SignalWire!</Body>
</Message>
</Response>
REST API
curl -L 'https://<YOUR_SPACE>.signalwire.com/api/laml/2010-04-01/Accounts/<PROJECT_ID_HERE>/Messages' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json' \
-H 'Authorization: Basic <BASE64 ENCODED AUTHENTICATION STRING>' \
-d 'To=%2B155512312345' \
-d 'From=%2B15555554321' \
-d 'Body=Hello%20from%20SignalWire!'
- SWML
- CXML
SWML
version: 1.0.0
sections:
main:
- receive_fax: {}
CXML
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<Receive></Receive>
</Response>
- Relay Realtime SDK (Server)
- Relay Browser SDK
Relay Realtime SDK (Server)
import { SignalWire } from "@signalwire/realtime-api";
const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" })
const chatClient = client.chat;
await chatClient.listen({
channels: ["channel1"],
onMessageReceived: async (message) => {
console.log(message.content);
}
});
await chatClient.publish({
channel: "channel1",
content: `Hello from SignalWire!`
})
Relay Browser SDK
import { Chat } from "@signalwire/js";
const chatClient = new Chat.Client({
token: "<your_chat_token>", // get this from the REST APIs
});
await chatClient.subscribe(["mychannel1", "mychannel2"]);
chatClient.on("message", (message) => {
console.log("Received", message.content,
"on", message.channel,
"at", message.publishedAt);
});
await chatClient.publish({
channel: "mychannel1",
content: `Hello from SignalWire!`,
});
- Relay Realtime SDK (Server)
- Relay Browser SDK
Relay Realtime SDK (Server)
import { SignalWire } from '@signalwire/realtime-api'
const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" })
const pubSubClient = client.pubSub;
await pubSubClient.listen({
channels: ["mychannel1"],
onMessageReceived: (message) => {
console.log(message);
}
});
await pubSubClient.publish({
channel: "mychannel1",
content: "Hello from SignalWire!"
});
Relay Browser SDK
import { PubSub } from "@signalwire/js";
const pubSubClient = new PubSub.Client({
token: "<your chat token>", // get this from the REST APIs
});
await pubSubClient.subscribe(["mychannel1", "mychannel2"]);
pubSubClient.on("message", (message) => {
console.log("Received", message.content,
"on", message.channel,
"at", message.publishedAt);
});
await pubSubClient.publish({
channel: "mychannel1",
content: "Hello from SignalWire!",
});
- Relay Realtime SDK (Server)
- Relay Browser SDK
Relay Realtime SDK (Server)
import { SignalWire } from "@signalwire/realtime-api";
// Initialize the SignalWire client
const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" });
// Access video client from the main client
const videoClient = client.video;
// Setup listener for when a room starts
await videoClient.listen({
onRoomStarted: async (roomSession) => {
console.log("Room started", roomSession.displayName);
roomSession.startStream({
url: "rtmp://example.com/stream"
})
}
});
Relay Browser SDK
import * as SignalWire from "@signalwire/js";
import axios from "axios";
const rtmpUrl = "rtmp://example.com/live";
async function connect() {
try {
await navigator.mediaDevices.getUserMedia({
video: true,
audio: true
});
} catch (e) {
console.error("Failed to get user media:", e);
return;
}
const reply = await axios.post(
"/get_token", // Make request to server to get video token from SignalWire Rest API
{
user_name: "user",
room_name: "room"
}
)
const roomSession = new SignalWire.Video.RoomSession({
token: reply.data.token, // Obtained from SignalWire REST API
rootElement: document.getElementById("video")
})
roomSession.on("stream.started", (m) => console.log(m));
try {
await roomSession.join()
await roomSession.startStream({ url: rtmpUrl })
} catch (e) {
console.error("Failed to join room:", e);
}
}
connect()
Join us!
8,000+ Users
90+ Repositories