Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.

Commit 9a88a47

Browse files
docs: updated changelog for v5.0.0
1 parent 93ae581 commit 9a88a47

2 files changed

Lines changed: 57 additions & 11 deletions

File tree

docs/docs/changelog.md

Lines changed: 56 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,79 @@ sidebar_position: 2
88

99
### Breaking Changes
1010

11-
### Capabilities deprecated
11+
The `Salable` class has been replaced with a new `initSalable` function. Using the new initialise function will enable
12+
vendors to use `v2` or `v3` of the API within the same version of the SDK.
13+
14+
**v4.0.0 implementation**
15+
```typescript
16+
const salable = new Salable('your-api-key', 'v2')
17+
```
18+
**v5.0.0 implementation**
19+
```typescript
20+
const salableV2 = initSalable('your-api-key', 'v2') // still supported
21+
const salableV3 = initSalable('your-api-key', 'v3')
22+
```
23+
24+
### V3 Breaking changes
25+
26+
#### Capabilities deprecated
1227
Capabilities used to be stored on the License at the point of creation with no way of editing them. We found this to be
1328
too rigid, for flexibility we have deprecated capabilities in favour of using the plan's feature values which are
1429
editable in the Salable app.
15-
#### Deprecated capabilities deprecated
30+
31+
##### Deprecated methods that use capabilities
1632
- `plans.capabilities`
17-
- `product.capabilities`
33+
- `products.capabilities`
1834
- `licenses.check`
1935

20-
### Licenses deprecated
36+
#### Licenses deprecated
2137
All license methods have been deprecated in favour of managing them through the subscription instead. This gives a
2238
consistent implementation across all types of subscriptions.
2339
- `licenses.create` moved to `subscriptions.create` - the `owner` value will be applied to the `purchaser` field of the license.
24-
- `license.check` moved to `entitlements.check`
40+
- `licenses.check` moved to `entitlements.check`
2541
- `licenses.getAll` moved to `subscriptions.getSeats`
26-
- `licenses.getOne` support removed
42+
- `licenses.getOne` support removed - fetch the parent subscription instead using `subscriptions.getOne`
2743
- `licenses.getForPurchaser` moved to `subscriptions.getAll` with the owner filter applied.
2844
- `licenses.update` moved to `subscriptions.update`
45+
- To update a seat's grantee use the `subscriptions.manageSeats` method.
2946
- `licenses.updateMany` moved to `subscriptions.manageSeats`
3047
- `licenses.getCount` moved to `subscriptions.getSeatCount`
3148
- `licenses.cancel` moved to `subscriptions.cancel` - this will cancel all the subscription's child licenses.
3249
- `licenses.cancelMany` moved to `subscriptions.cancel` - it is not possible to cancel many subscriptions in the same request.
3350

51+
#### Other deprecated endpoints
52+
- `products.getFeatures` moved to `features.getAll` with the `productUuid` filter applied.
53+
- `products.getPlans` moved to `plans.getAll` with the `productUuid` filter applied.
54+
55+
#### Affected responses
56+
- `products.getAll` now uses cursor-based pagination in the response.
57+
58+
### What's new?
59+
#### New methods
60+
- `features.getAll` - Retrieves all features for an organisation. The response uses cursor-based pagination.
61+
- `plans.getAll` - Retrieves all plans for an organisation. The response uses cursor-based pagination.
62+
- `entitlements.check` - Check grantee access to specific features (replaces `licenses.check`).
63+
64+
**v4.0.0 SDK with API v2**
65+
```typescript
66+
const salable = new Salable('your-api-key', 'v2');
67+
const check = await salable.licenses.check({
68+
productUuid: 'your-product-uuid',
69+
granteeIds: ['your-grantee-id'],
70+
});
71+
const hasAccess = check?.capabilities.find((c) => c.capability === 'your-boolean-feature');
72+
```
73+
74+
**v5.0.0 SDK with API v3**
75+
```typescript
76+
const salable = initSalable('your-api-key', 'v3');
77+
const check = await salable.entitlements.check({
78+
productUuid: 'your-product-uuid',
79+
granteeIds: ['your-grantee-id'],
80+
});
81+
const hasAccess = check.features.find((f) => f.feature === 'your-boolean-feature');
82+
```
83+
3484
## v4.0.0
3585

3686
### Breaking Changes

src/schemas/v3/schemas-v3.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
import {
22
FeatureEnumOption,
33
FeatureV3,
4-
Invoice,
54
LicenseV3,
65
OrganisationPaymentIntegrationV3,
76
PaginatedLicenses,
8-
PaginatedSubscription,
9-
PaginatedSubscriptionInvoice,
107
PlanCurrency,
118
PlanFeatureV3,
129
PlanV3,
1310
PricingTableV3,
1411
ProductCurrency,
1512
ProductPricingTableV3,
1613
ProductV3,
17-
Subscription,
1814
} from '../../types';
19-
import { EnumValueSchema, LicenseSchema, SubscriptionSchema } from '../v2/schemas-v2';
15+
import { EnumValueSchema} from '../v2/schemas-v2';
2016

2117
export const ProductSchemaV3: ProductV3 = {
2218
uuid: expect.any(String),

0 commit comments

Comments
 (0)