You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-12Lines changed: 11 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,34 +9,33 @@ Let’s walk through setting up a project that uses the Salable API Class from t
9
9
1. Create a new Node.js project.
10
10
2. Inside of the project, run: `npm install @salable/node-sdk`. Adding packages results in update in lock file, [yarn.lock](https://yarnpkg.com/getting-started/qa/#should-lockfiles-be-committed-to-the-repository) or [package-lock.json](https://docs.npmjs.com/configuring-npm/package-lock-json). You **should** commit your lock file along with your code to avoid potential breaking changes.
11
11
12
-
## v4.0.0 Update
12
+
## v5.0.0 Update
13
13
14
14
The SDK now supports Salable API version selection and developers can choose which version of the Salable API they want to interact with via the SDK
15
-
As such, the Salable API version is now a required argument when instantiating the SDK
15
+
As such, the Salable API version is now a required argument when instantiating the SDK
16
16
17
17
```typescript
18
-
import { Salable } from'@salable/node-sdk';
18
+
import { initSalable } from'@salable/node-sdk';
19
19
20
-
const salable =newSalable('your_api_key', 'v2');
20
+
const salable =initSalable('your_api_key', 'v3');
21
21
```
22
-
> **_NOTE:_** Support for `v1` of the Salable API has been deprecated, `v2` is currently the only supported version
23
22
24
23
### General Changes
25
24
26
25
#### Salable API versioning and Types
27
26
- Types and method documentation are dynamic and automatically adjust to the version selected
28
27
29
28
```typescript
30
-
import { Salable } from'@salable/node-sdk';
29
+
import { initSalable } from'@salable/node-sdk';
31
30
32
-
constsalableV1=newSalable('your_api_key', 'v1');// NOTE: 'v1' is not supported and used for example purposes
33
-
constsalableV2=newSalable('your_api_key', 'v2');
31
+
constsalableV2=initSalable('your_api_key', 'v2');
32
+
constsalableV3=initSalable('your_api_key', 'v3');
34
33
35
-
//The "licenses.getUsage" method is supported in this version and will work
36
-
awaitsalableV1.licenses.getUsage():
34
+
// "licenses.check" method is supported in this version and will work
35
+
awaitsalableV2.licenses.check();
37
36
38
-
// This will error as "licenses.getUsage" has been deprecated in 'v2'
39
-
awaitsalableV2.licenses.getUsage():// Will error with: "Property 'getUsage' does not exist ..."
37
+
// This will error as all "licenses" methods has been deprecated in 'v3'
38
+
awaitsalableV3.licenses.check();// Will error with: "Property 'licenses' does not exist ..."
40
39
```
41
40
#### Pagination
42
41
- All methods are now scope authorized and your API Key must contain the appropriate scopes to user certain methods
0 commit comments