https://github.com/bandwidth/node-voice
Node SDK for Bandwidth Voice
https://github.com/bandwidth/node-voice
Last synced: 10 months ago
JSON representation
Node SDK for Bandwidth Voice
- Host: GitHub
- URL: https://github.com/bandwidth/node-voice
- Owner: Bandwidth
- License: other
- Created: 2019-12-11T16:31:54.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2025-03-25T03:23:37.000Z (11 months ago)
- Last Synced: 2025-03-25T04:24:05.368Z (11 months ago)
- Language: TypeScript
- Homepage: https://dev.bandwidth.com
- Size: 2.46 MB
- Stars: 3
- Watchers: 17
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# $${\color{orange}This \space package \space has \space been \space deprecated}$$
# Please use the new [node-sdk](https://github.com/Bandwidth/node-sdk)
## The new package is on NPM as [bandwidth-sdk](https://www.npmjs.com/package/bandwidth-sdk) (`npm i bandwidth-sdk`)
# Bandwidth Node Voice SDK
[](https://github.com/Bandwidth/node-voice/actions/workflows/test.yml)
| **OS** | **Node** |
|:---:|:---:|
| Windows 2016 | 12, 14, 16 |
| Windows 2019 | 12, 14, 16 |
| Ubuntu 20.04 | 12, 14, 16 |
| Ubuntu 22.04 | 12, 14, 16 |
Note: As of version 2.0.0, this package has been upgraded to TypeScript
## Getting Started
### Installation
```
npm install @bandwidth/voice
```
### Initialize
```
import { CreateCallRequest, ApiError, ApiController, Client, Response, SpeakSentence } from '@bandwidth/voice';
const client = new Client({
basicAuthUserName: "username",
basicAuthPassword: "password"
});
const controller = new ApiController(client);
const accountId = "12345";
```
*To use a custom environment*
```
import { ApiController, Client, Environment } from '@bandwidth/voice';
const client = new Client({
basicAuthUserName: "username",
basicAuthPassword: "password",
environment: Environment.Custom,
baseUrl: 'https://custom.bandwidth.com'
});
const controller = new ApiController(client);
const accountId = "12345";
```
### Create A Phone Call
```
var from = "+15554443333";
var to = "+15553334444";
var answerUrl = "https://sample.com";
var applicationId = "3-a-b-c";
var body = {
from: from,
to: to,
answerUrl: answerUrl,
applicationId: applicationId,
};
var createCallResponse = await controller.createCall(accountId, body);
console.log(createCallResponse.result.callId);
```
### Create BXML
```
var speakSentence = new SpeakSentence({
sentence: "test",
voice: "susan",
gender: "female",
locale: "en_US",
});
var response = new Response(speakSentence);
console.log(response.toBxml());
```
## Supported Node Versions
This package can be used with Node >= 10
## Credentials
Information for credentials for this package can be found at https://dev.bandwidth.com/guides/accountCredentials.html