## {{npmName}}
[](https://github.com/Bandwidth/node-sdk/actions/workflows/deploy.yml)
| **OS** | **Node** |
|:------------:|:----------:|
| Windows 2022 | 18, 20, 22, 24 |
| Windows 2025 | 18, 20, 22, 24 |
| Ubuntu 22.04 | 18, 20, 22, 24 |
| Ubuntu 24.04 | 18, 20, 22, 24 |
#### Available on NPM
```
npm install {{npmName}}
```
#### To Run Unit Tests Locally
1. Install Prism
```bash
npm install -g @stoplight/prism-cli
```
2. Start Prism Mock Server with the OpenAPI Spec
```bash
prism mock bandwidth.yml
```
3. Run Tests
```bash
npm run test-unit
```
This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
Environment
* Node.js
* Webpack
* Browserify
Language level
* ES5 - you must have a Promises/A+ library installed
* ES6
Module system
* CommonJS
* ES6 module system
It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html))
### Building
To build and compile the typescript sources to javascript use:
```
npm install
npm run build
```
### Publishing
First build the package then run `npm publish`
### Consuming
navigate to the folder of your consuming project and run one of the following commands.
_published:_
```
npm install {{npmName}} --save
```
_unPublished (not recommended):_
```
npm install PATH_TO_GENERATED_PACKAGE --save
```
### Getting Started
The following is a simple example of how to use this module:
```javascript
import { CallsApi, Configuration } from '{{npmName}}';
const config = new Configuration({
clientId: BW_CLIENT_ID,
clientSecret: BW_CLIENT_SECRET
});
const callsApi = new CallsApi(config);
const body = {
applicationId: BW_VOICE_APPLICATION_ID,
to: TO_NUMBER,
from: BW_NUMBER
};
await callsApi.createCall(BW_ACCOUNT_ID, body);
```
More samples can be found in the [Bandwidth Samples](https://github.com/orgs/Bandwidth-Samples/repositories?q=lang%3Ajavascript&type=all) GitHub Organization.
### Documentation for API Endpoints
All URIs are relative to *{{{basePath}}}*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}}
{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}}
### Documentation For Models
{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md)
{{/model}}{{/models}}
## Documentation For Authorization
{{^authMethods}}Endpoints do not require authorization.{{/authMethods}}
{{#hasAuthMethods}}Authentication schemes defined for the API:{{/hasAuthMethods}}
{{#authMethods}}
### {{{name}}}
{{#isApiKey}}
- **Type**: API key
- **API key parameter name**: {{{keyParamName}}}
- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}}
{{/isApiKey}}
{{#isBasic}}
{{#isBasicBasic}}
- **Type**: HTTP basic authentication
{{/isBasicBasic}}
{{#isBasicBearer}}
- **Type**: Bearer authentication{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}
{{/isBasicBearer}}
{{#isHttpSignature}}
- **Type**: HTTP signature authentication
{{/isHttpSignature}}
{{/isBasic}}
{{#isOAuth}}
- **Type**: OAuth
- **Flow**: {{{flow}}}
- **Authorization URL**: {{{authorizationUrl}}}
- **Scopes**: {{^scopes}}N/A{{/scopes}}
{{#scopes}} - **{{{scope}}}**: {{{description}}}
{{/scopes}}
{{/isOAuth}}
{{/authMethods}}