@vonage/server-client
Advanced tools
Comparing version 1.7.0 to 1.8.0
@@ -5,1 +5,2 @@ export { Client } from './client'; | ||
export * from './transformers'; | ||
export * from './fileClient'; |
@@ -23,2 +23,3 @@ "use strict"; | ||
__exportStar(require("./transformers"), exports); | ||
__exportStar(require("./fileClient"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@vonage/server-client", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"description": "Core services related to talking to the Vonage APIs", | ||
@@ -30,3 +30,3 @@ "homepage": "https://developer.vonage.com", | ||
"dependencies": { | ||
"@vonage/auth": "^1.5.0", | ||
"@vonage/auth": "^1.6.0", | ||
"@vonage/vetch": "^1.5.0", | ||
@@ -41,2 +41,3 @@ "debug": "^4.3.4", | ||
"devDependencies": { | ||
"mock-fs": "5.2.0", | ||
"nock": "^13.3.1" | ||
@@ -43,0 +44,0 @@ }, |
@@ -5,6 +5,7 @@ # Vonage Auth SDK for Node.js | ||
<img src="https://developer.nexmo.com/images/logos/vbc-logo.svg" height="48px" alt="Vonage" /> | ||
This is the Vonage Server Client SDK for Node.js used to wrap the authentication headers/signatures for use with [Vonage APIs](https://www.vonage.com/). To use it you will need a Vonage account. Sign up [for free at vonage.com][signup]. | ||
This is the Vonage Server Client SDK for Node.js used to wrap the authentication | ||
headers/signatures for use with [Vonage APIs](https://www.vonage.com/). To use | ||
it you will need a Vonage account. Sign up [for free at vonage.com][signup]. | ||
@@ -15,3 +16,4 @@ For full API documentation refer to [developer.vonage.com](https://developer.vonage.com/). | ||
* [Usage](#usage) | ||
* [Options](#options) | ||
* [Options](#options) | ||
* [File Downloads](#file-downloads) | ||
* [Testing](#testing) | ||
@@ -33,3 +35,3 @@ | ||
## Using the Vonage Server-Client SDK | ||
## Usage | ||
@@ -60,3 +62,5 @@ To create a client, you will need to pass in a `@vonage/auth` object. | ||
The constructor for the client takes in two parameters `credentials` and `options`. `credentials` is either an [`Auth`](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/auth/lib/auth.ts#L13) or an `object` containing the settings from [`AuthInterface`](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/auth/lib/types.ts#L35). | ||
The constructor for the client takes in two parameters `credentials` and | ||
`options`. `credentials` is either an [`Auth`](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/auth/lib/auth.ts#L13) | ||
or an `object` containing the settings from [`AuthInterface`](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/auth/lib/types.ts#L35). | ||
@@ -68,5 +72,30 @@ `options` allows adjusting api endpoints and the request timeout. | ||
* `videoHost: string` (optional) - Allows overwriting the default `https://video.api.vonage.com`. | ||
* `timeout: int` (optional) - Set a custom timeout for requests to Vonage in milliseconds. Defaults to the standard for Node http requests, which is 120,000 ms. | ||
* `appendUserAgent: string` (optional) - Set a custom string to be added to the `user-agent` header for the request | ||
* `timeout: int` (optional) - Set a custom timeout for requests to Vonage in | ||
milliseconds. Defaults to the standard for Node http requests, which is | ||
120,000 ms. | ||
* `appendUserAgent: string` (optional) - Set a custom string to be added to the | ||
`user-agent` header for the request | ||
## File Downloads | ||
When downloading files, the request needs to be built with proper security | ||
headers set. Inside this package is the `FileClient` which will handle the | ||
request. You can download a file using the File Id or the FQURL. | ||
```js | ||
const { Auth } = require('@vonage/auth'); | ||
const { FileClient } = require('@vonage/server-client'); | ||
const fileClient = new FileClient(new Auth({ | ||
apiKey: API_KEY, | ||
apiSecret: API_SECRET, | ||
applicationId: APP_ID, | ||
privateKey: PRIVATE_KEY_PATH, | ||
}), | ||
options, | ||
); | ||
await fileClient.downloadFile('the-file-id-or-url', '/paht/to/save'); | ||
``` | ||
## Testing | ||
@@ -73,0 +102,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
31993
38
443
106
2
1
Updated@vonage/auth@^1.6.0