@enfonica/voice
Version:
Enfonica Numbering SDK for Node.js
46 lines (34 loc) • 1.27 kB
Markdown
Node.js idiomatic client library for [Enfonica](https://enfonica.com/) services. This library uses version 'v1beta1' of the Enfonica Voice API. View the docs for more details: [Enfonica Docs](https://enfonica.github.io/enfonica-node/voice/)
The library supports the version 10 and above of Node.js.
```bash
npm install @enfonica/voice
```
Define the environment variable `ENFONICA_APPLICATION_CREDENTIALS` to be the location of your service account key file, alternatively add this to a .env file. For example:
```
set ENFONICA_APPLICATION_CREDENTIALS=/path/to/key.json
```
You can obtain a service account key file from the [Enfonica Console](https://console.enfonica.com/).
```js
import voice from '@enfonica/voice';
const client = new voice.RecordingsClient({
keyFile: process.env.ENFONICA_APPLICATION_CREDENTIALS
});
(async () => {
try {
const request = {
// Request body
}
const iterable = client.listRecordingsAsync(request);
for await (const response of iterable) {
// process response
}
} catch (error) {
console.log(error);
}
})();
```