Skip to content

Commit a95e01d

Browse files
6.0.0 Typescript GA release (#32)
1 parent d51532b commit a95e01d

236 files changed

Lines changed: 10660 additions & 3016 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 140 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,149 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4-
## [5.1.0-beta.1] - revision 2023-08-15
4+
## [6.0.0] - revision 2023-09-15
5+
### Added
6+
7+
- Typescript Support
8+
- Types - This is a complete rework of our node sdk to add native type support in package
9+
10+
- `Images` API
11+
- We now support the following operations to work with images:
12+
- `get_image`
13+
- `get_images`
14+
- `update_image`
15+
- `upload_image_from_file` - You can se `fs.createReadStream` to pass the file into the function
16+
- `upload_image_from_url`
17+
- `Coupons` API
18+
- We now support CRUD operations for both Coupons and Coupon Codes
19+
- Check out [Coupons API guide](https://developers.klaviyo.com/en/docs/use_klaviyos_coupons_api) for more information.
20+
- Additional filtering/sorting option for Lists and Segments: `joined_group_at`
21+
- New profile merge endpoint: `ProfilesApi.mergeProfiles`
22+
- Increased the maximum page size limit for List and Segment Profile Relationship Endpoints to 1000
23+
24+
### Changed
25+
26+
- Authentication - Changes were made to make way for upcomming OAuth support
27+
- Now use `ApiKeySession` object to pass in the authentication into an api constructor. The readme has plenty of examples.
28+
- `ConfigWrapper` should still work it now just updates the `GlobalApiKeyConfig` and creates an `ApiKeySession` instance
29+
30+
## [5.1.0] - revision 2023-08-15
531
### Added
632
- Flow Message Templates
7-
- You can now retrieve the templates associated with flow messages using `flowsApi.getFlowMessageTemplate()` or `flowsApi.getFlowMessageRelationshipsTemplate()` . You’re also able to include the template HTML for a flow message using `flowsApi.getFlowMessage(FLOW_MESSAGE_ID, {include: ['template']})`.
33+
- You can now retrieve the templates associated with flow messages using `Flows.getFlowMessageTemplate()` or `Flows.getFlowMessageRelationshipsTemplate()` . You’re also able to include the template HTML for a flow message using `Flows.getFlowMessage(FLOW_MESSAGE_ID, {include: ['template']})`.
834
- Create or Update Push Tokens
9-
- We have added an endpoint to create push tokens, `profilesApi.createPushToken()`. This endpoint can be used to migrate profiles and their push tokens from another platform to Klaviyo. If you’re looking to register push tokens from users’ devices, please use our mobile SDKs.
35+
- We have added an endpoint to create push tokens, `Profiles.createPushToken()`. This endpoint can be used to migrate profiles and their push tokens from another platform to Klaviyo. If you’re looking to register push tokens from users’ devices, please use our mobile SDKs.
36+
37+
## [5.0.0] - revision 2023-07-15
38+
### Added
39+
- Back-In-stock APIs
40+
- We have added support for subscribing profiles to back-in-stock notifications, for both email and SMS, using the new [create_back_in_stock_subscription](./README.md#create-back-in-stock-subscription) endpoint.
41+
- New functionality to Campaigns API
42+
- CRUD support for SMS campaigns is now available
43+
- You can now also retrieve all messages for a campaign to determine performance data on campaigns where you're running A/B tests
44+
- To support this functionality, we introduced a relationship between [campaigns and campaign messages](./README.md#get-campaign-relationships-campaign-messages), and between [campaign messages and templates](./README.md#get-campaign-message-relationships-template)
45+
46+
47+
### Changed
48+
- Relationship Standardization
49+
- We are making a number of changes across endpoints to standardize how we handle [relationships](https://developers.klaviyo.com/en/docs/relationships_) in our APIs and leverage consistently typed objects across endpoints. For example, you can create a profile in our APIs in the same shape, regardless of whether you're calling the profiles endpoint or the events endpoint.
50+
- The changes include:
51+
- Updating 1:1 relationships to use singular tense and an object (instead of plural and an array)
52+
- example: for [get_flow_action](./README.md#get-flow-action), if you want to use the `include` param, you would set `include=` to `"flow"` (instead of `"flows"`)
53+
- Moving related object IDs from the attributes payload to relationships
54+
- example: The format for the [body](https://developers.klaviyo.com/en/reference/create_tag) of [create_tag](./README.md#create-tag) has changed, with `tag_group_id` previously at `data.attributes.tag_group_id` being removed and replaced by a `data` object containing `type`+`id` and located at `data.relationships.tag-group.data`.
55+
- Specifying a relationship between two Klaviyo objects to allow for improved consistency and greater interoperability across endpoints
56+
- example: for [create_event](./README.md#create-event), you can now create/update a profile for an event in the same way you would when using the profiles API directly
57+
- NOTE: The examples for the above relationship changes are illustrative, not comprehensive. For a complete list of ALL the endpoints that have changed and exactly how, please refer to our latest [API Changelog](https://developers.klaviyo.com/en/docs/changelog_#revision-2023-07-15)
58+
- For [get_campaigns](./README.md#get-campaigns) endpoint, `filter` param is now required, to, at minimum, filter on `messages.channel`
59+
60+
61+
### Removed
62+
- We removed the `company_id` from the response for [get_template](./README.md#get-template) and [get_templates](./README.md#get-templates). If you need to obtain the company ID / public API key for an account, please use the [Accounts API](./README.md#accounts).- We removed the `company_id` from the response for [get_template](./README.md#get-template) and [get_templates](./README.md#get-templates). If you need to obtain the company ID / public API key for an account, please use the [Accounts API](./README.md#accounts).
63+
64+
## [4.0.0] - revision 2023-06-15
65+
### Added
66+
- Accounts API is now available, this will allow you to access information about the Klaviyo account associated with your API key.
67+
- `getAccounts`
68+
- `getAccount`
69+
70+
**Note:** You will need to generate a new API key with either the `Accounts` scope enabled or `Full Access` to use these endpoints.
71+
72+
### Changed
73+
- `createProfile` - opts parameter removed because there are no optional query parameter that can be passed to the endpoint
74+
75+
### Removed
76+
- All `client` endpoints - While you could potentially get this repo to work for frontend and use only these client endpoints, it is bad practice to use client-side endpoints on the server side. In addition, developers found the inclusion of the client-side endpoints in our SDKs generally confusing.
77+
- `createClientEvent`
78+
- `createClientProfile`
79+
- `createClientSubscription`
80+
81+
Klaviyo has the much lighter weight `klaviyo.js` wrapper that we recommend for client-side use [which you can read about here.](https://developers.klaviyo.com/en/docs/introduction_to_the_klaviyo_object)
1082

83+
In addition, you can [make client-side API calls](https://developers.klaviyo.com/en/reference/create_client_event) outright if desired.
1184

12-
## [5.0.0-beta.1] - revision 2023-07-15
85+
## [3.0.0] - revision 2023-02-22
1386
### Added
14-
- Types - This is a complete rework of our node sdk to add native type support in package
15-
- ConfigWrapper is now optional
16-
- Pass your api key and optional retry data directly into API objects `new campaignsApi("<YOUR API KEY HERE>")`
17-
- Optional `Klaviyo` scope
18-
- Instead of accessing items apis like `new campaignsApi()` you can also use `new Klaviyo.campaignsApi()` to keep your application organized.
87+
- Profiles API now returns predictive analytics when calling `getProfile` and `getProfiles` by passing in `additionalFieldsProfile = ["predictive_analytics"]`.
88+
89+
```javascript
90+
const response = await Profiles.getProfiles({additionalFieldsProfile: ["predictive_analytics"]})
91+
```
92+
93+
### Changed
94+
- Relationship endpoints that were previously grouped together are now split into related-resource-specific endpoints.
95+
96+
### Migration Guide
97+
- To migrate to this latest version, all calls to relationship endpoints need to be updated, as in the following example:
98+
- `getCampaignRelationships(campaignId, "tags")` will become `getCampaignRelationshipsTags(campaignId)`.
99+
100+
## [2.1.1] - revision 2023-02-22
101+
### Changes
102+
- Multi-store
103+
- ConfigWrappers passed into the api wrappers now works as intended
104+
- PageSize is now added as an optional param to the following endpoints
105+
- Segments
106+
- getSegmentProfiles
107+
- Profiles
108+
- getProfiles
109+
- Lists
110+
- getListProfiles
111+
112+
## [2.1.0] - revision 2023-02-22
113+
114+
### Added
115+
- Campaigns (which were previously in our Beta API/SDKs)
116+
117+
### Changes
118+
- Flows
119+
- Pagination changed from page offset to cursor
120+
121+
## [2.0.0] - revision 2023-01-24
122+
123+
- Added the following endpoints (which were previously in our Beta APIg/SDKs):
124+
- Data Privacy
125+
- All Tags endpoints, as well as the following related resource-specific endpoints:
126+
- Get Flow Tags
127+
- Get List Tags
128+
- Get Segment Tags
129+
- Reworked the response object from returned by SDK methods
130+
- instead of only returning the response payload, the status code and headers are now also returned
131+
- The API response payload is now nested under `body` within the API response returned by SDK methods. You can get the `id` of the returned resource by calling `response.body.data.id` instead of `response.data.id` from previous releases. You can get response headers and status with `response.headers` and `response.status` respectively.
132+
133+
## [1.0.2] - revision: 2022-10-19 (update: 2022-12-19)
134+
135+
### Changes
136+
- fix `babel/cli` location in `package.json` to be in devDependencies
137+
- when passing pageCursor the returned link.next url will be automatically parsed for the page cursor
138+
139+
## [1.0.0] - revision: 2022-10-19
140+
141+
### Added
142+
- Initial release
143+
144+
### Changes
145+
- Naming changes from beta:
146+
- Package name: klaviyo-sdk-beta → klaviyo-api
147+
- Some functions have changed name
148+
- New resources and endpoints:
149+
- See [API Changelog](https://developers.klaviyo.com/en/docs/changelog_) for full details

MIGRATION.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
### Steps
44
- Swap to the new version:
5-
- updating your `package.json` manually to the current beta version
6-
- currently, there are no known breaking changes from moving from the node sdk to the TypeScript Beta sdk
5+
- Updating your `package.json` to a version >= 6.0.0
6+
- If you were modifying the `ApiClient` returned from `ConfigWrapper` object manually you will need to update you code
7+
to use the new `Session` objects
78

89

910
### Work done to make migration easier
1011
- Most current imports should still work.
11-
- ConfigWrapper has been recreated, is now optional, and it now works differently under the hood. However, you can still use it to set a global api key, or pass it into an API constructor
12+
- `ConfigWrapper` has been recreated, is now optional, and it now works differently under the hood. However, you can still use it to set a global api key, or pass it into an API constructor
1213
- Optional params should all have the same names, but now they have type support, letting you know which optional params are used on which endpoints
1314

1415
### Known manual migration issues

0 commit comments

Comments
 (0)