@vonage/accounts 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -30
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,32 +1,21 @@
|
|
|
1
1
|
# Vonage Accounts SDK for Node.js
|
|
2
2
|
|
|
3
|
-
](https://codecov.io/gh/Vonage/vonage-server-sdk)
|
|
5
|
-

|
|
6
|
-
[](../../CODE_OF_CONDUCT.md)
|
|
7
|
-
[][license]
|
|
3
|
+
 [](https://codecov.io/gh/Vonage/vonage-server-sdk)  [](../../CODE_OF_CONDUCT.md) [][license]
|
|
8
4
|
|
|
9
5
|
<img src="https://developer.nexmo.com/images/logos/vbc-logo.svg" height="48px" alt="Vonage" />
|
|
10
6
|
|
|
11
|
-
This is the Vonage Account SDK for Node.js for use with
|
|
12
|
-
[Vonage APIs](https://www.vonage.com/). To use it you will need a Vonage
|
|
13
|
-
account. Sign up [for free at vonage.com][signup].
|
|
14
|
-
|
|
15
|
-
We recommend using this package as part of the overall
|
|
16
|
-
[`@vonage/server-sdk` package](https://github.com/vonage/vonage-node-sdk).
|
|
7
|
+
This is the Vonage Account SDK for Node.js 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].
|
|
17
8
|
|
|
18
9
|
For full API documentation refer to [developer.vonage.com](https://developer.vonage.com/).
|
|
19
10
|
|
|
20
11
|
* [Installation](#installation)
|
|
21
|
-
* [Usage](#
|
|
12
|
+
* [Usage](#usage)
|
|
22
13
|
* [Promises](#promises)
|
|
23
14
|
* [Testing](#testing)
|
|
24
15
|
|
|
25
16
|
## Installation
|
|
26
17
|
|
|
27
|
-
We recommend using this SDK as part of the overall
|
|
28
|
-
[`@vonage/server-sdk` package](https://github.com/vonage/vonage-node-sdk).
|
|
29
|
-
Please see the main package for installation.
|
|
18
|
+
We recommend using this SDK as part of the overall [`@vonage/server-sdk` package](https://github.com/vonage/vonage-node-sdk). Please see the main package for installation.
|
|
30
19
|
|
|
31
20
|
You can also use this SDK standalone if you only need access to just the Accounts API.
|
|
32
21
|
|
|
@@ -42,43 +31,40 @@ npm install @vonage/accounts
|
|
|
42
31
|
yarn add @vonage/accounts
|
|
43
32
|
```
|
|
44
33
|
|
|
45
|
-
##
|
|
34
|
+
## Usage
|
|
46
35
|
|
|
47
36
|
### As part of the Vonage Server SDK
|
|
48
37
|
|
|
49
|
-
If you are using this SDK as part of the Vonage Server SDK, you can access it
|
|
50
|
-
as the `accounts` property off of the client that you instantiate.
|
|
38
|
+
If you are using this SDK as part of the Vonage Server SDK, you can access it as the `accounts` property off of the client that you instantiate.
|
|
51
39
|
|
|
52
40
|
```js
|
|
53
41
|
const { Vonage } = require('@vonage/server-sdk');
|
|
54
42
|
|
|
55
|
-
const vonage = new Vonage(
|
|
43
|
+
const vonage = new Vonage(
|
|
44
|
+
{
|
|
56
45
|
apiKey: API_KEY,
|
|
57
46
|
apiSecret: API_SECRET,
|
|
58
|
-
applicationId: APP_ID,
|
|
59
47
|
privateKey: PRIVATE_KEY_PATH,
|
|
60
48
|
signatureSecret: SIGNATURE_SECRET,
|
|
61
49
|
signatureMethod: SIGNATURE_METHOD
|
|
62
|
-
},
|
|
50
|
+
},
|
|
51
|
+
options
|
|
52
|
+
);
|
|
63
53
|
|
|
64
54
|
const balance = await vonage.accounts.getBalance();
|
|
65
55
|
```
|
|
66
56
|
|
|
67
57
|
### Standalone
|
|
68
58
|
|
|
69
|
-
The SDK can be used standalone from the main
|
|
70
|
-
[Vonage Server SDK for Node.js](https://github.com/vonage/vonage-node-sdk) if
|
|
71
|
-
you only need to use the Account APIs. All you need to do is
|
|
72
|
-
`require('@vonage/account')`, and use the returned object to create your own
|
|
73
|
-
client.
|
|
59
|
+
The SDK can be used standalone from the main [Vonage Server SDK for Node.js](https://github.com/vonage/vonage-node-sdk) if you only need to use the Account APIs. All you need to do is `require('@vonage/account')`, and use the returned object to create your own client.
|
|
74
60
|
|
|
75
61
|
```js
|
|
76
62
|
const { Auth } = require('@vonage/auth');
|
|
77
63
|
const { Accounts } = require('@vonage/account');
|
|
78
64
|
|
|
79
65
|
const credentials = new Auth({
|
|
80
|
-
|
|
81
|
-
|
|
66
|
+
apiKey: API_KEY,
|
|
67
|
+
apiSecret: API_SECRET,
|
|
82
68
|
});
|
|
83
69
|
|
|
84
70
|
const options = {}
|
|
@@ -86,8 +72,8 @@ const options = {}
|
|
|
86
72
|
const accountClient = new Accounts(credentials, options);
|
|
87
73
|
```
|
|
88
74
|
|
|
89
|
-
`credentials` is any option from [`@vonage/auth`](https://github.com/Vonage/vonage-node-sdk/
|
|
90
|
-
and `options` is any option from [`@vonage/server-client`](https://github.com/Vonage/vonage-node-sdk/
|
|
75
|
+
`credentials` is any option from [`@vonage/auth`](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/auth/README.md#options),
|
|
76
|
+
and `options` is any option from [`@vonage/server-client`](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/server-client/README.md#options)
|
|
91
77
|
|
|
92
78
|
## Promises
|
|
93
79
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vonage/accounts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Vonage Account Management API",
|
|
5
5
|
"homepage": "https://developer.vonage.com",
|
|
6
6
|
"bugs": {
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"compile": "npx tsc --build --verbose"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@vonage/server-client": "^1.
|
|
30
|
+
"@vonage/server-client": "^1.4.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@vonage/auth": "^1.
|
|
33
|
+
"@vonage/auth": "^1.3.0",
|
|
34
34
|
"nock": "^13.2.9"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|