Releases: klaviyo/klaviyo-api-node
v.7.0.0-beta.1 OAuth
Adds OAuth support and various helpers.
Check out the readme or the example integration
v6.0.1
[6.0.1] - revision 2023-09-15
Fixed
Relationship
and its child attributes were incorrectly marked as optional for the following endpointscreateBackInStockSubscription
createCampaignMessageAssignTemplate
spawnCreateVariantsJob
createCatalogVariant
spawnCouponCodeBulkCreateJob
createCouponCode
mergeProfiles
subscribeProfiles
- Removed unused dependencies from
package.json
that were requiring a higher node version than necessary
v6.0.0 - Typescript GA
[6.0.0] - revision 2023-09-15
Added
-
Typescript Support
- Types - This is a complete rework of our node sdk to add native type support in package
-
Images
API- We now support the following operations to work with images:
get_image
get_images
update_image
upload_image_from_file
- You can sefs.createReadStream
to pass the file into the functionupload_image_from_url
- We now support the following operations to work with images:
-
Coupons
API- We now support CRUD operations for both Coupons and Coupon Codes
- Check out Coupons API guide for more information.
-
Additional filtering/sorting option for Lists and Segments:
joined_group_at
-
New profile merge endpoint:
ProfilesApi.mergeProfiles
-
Increased the maximum page size limit for List and Segment Profile Relationship Endpoints to 1000
Changed
- Authentication - Changes were made to make way for upcomming OAuth support
- Now use
ApiKeySession
object to pass in the authentication into an api constructor. The readme has plenty of examples. ConfigWrapper
should still work it now just updates theGlobalApiKeyConfig
and creates anApiKeySession
instance
- Now use
v5.1.0
Added
- Flow Message Templates
- 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']}).
- Create or Update Push Tokens
- 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.
v5.1.0-beta.1 Typescript
Added
- Flow Message Templates
- You can now retrieve the templates associated with flow messages using
flowsApi.getFlowMessageTemplate()
orflowsApi.getFlowMessageRelationshipsTemplate()
. You’re also able to include the template HTML for a flow message usingflowsApi.getFlowMessage(FLOW_MESSAGE_ID, {include: ['template']})
.
- You can now retrieve the templates associated with flow messages using
- Create or Update Push Tokens
- 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.
- We have added an endpoint to create push tokens,
Fixes
- Campaign Message Template
- Fixed response model to be a template and not a campaign message
v5.0.0-beta.1 Typescript
Added
- Types - This is a complete rework of our node sdk to add native type support in package
- ConfigWrapper is now optional
- Pass your api key and optional retry data directly into API objects
new campaignsApi("<YOUR API KEY HERE>")
- Pass your api key and optional retry data directly into API objects
- Optional
Klaviyo
scope- Instead of accessing items apis like
new campaignsApi()
you can also usenew Klaviyo.campaignsApi()
to keep your application organized.
- Instead of accessing items apis like
5.0.0 - New endpoints and relationships rework
Added
- Back-In-stock APIs
- 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 endpoint.
- New functionality to Campaigns API
- CRUD support for SMS campaigns is now available
- You can now also retrieve all messages for a campaign to determine performance data on campaigns where you're running A/B tests
- To support this functionality, we introduced a relationship between campaigns and campaign messages, and between campaign messages and templates
Changed
- Relationship Standardization
- We are making a number of changes across endpoints to standardize how we handle 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.
- The changes include:
- Updating 1:1 relationships to use singular tense and an object (instead of plural and an array)
- example: for get_flow_action, if you want to use the
include
param, you would setinclude=
to"flow"
(instead of"flows"
)
- example: for get_flow_action, if you want to use the
- Moving related object IDs from the attributes payload to relationships
- example: The format for the body of create_tag has changed, with
tag_group_id
previously atdata.attributes.tag_group_id
being removed and replaced by adata
object containingtype
+id
and located atdata.relationships.tag-group.data
.
- example: The format for the body of create_tag has changed, with
- Specifying a relationship between two Klaviyo objects to allow for improved consistency and greater interoperability across endpoints
- example: for create_event, you can now create/update a profile for an event in the same way you would when using the profiles API directly
- Updating 1:1 relationships to use singular tense and an object (instead of plural and an array)
- 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
- For get_campaigns endpoint,
filter
param is now required, to, at minimum, filter onmessages.channel
Removed
- We removed the
company_id
from the response for get_template and get_templates. If you need to obtain the company ID / public API key for an account, please use the Accounts API.- We removed thecompany_id
from the response for get_template and get_templates. If you need to obtain the company ID / public API key for an account, please use the Accounts API.
4.0.1 - update superagent depency
Older version of superagent has dependencies that can cause issues with webpack. This bump should prevent that issue.
4.0.0 - Adding Accounts API
[4.0.0] - revision 2023-06-15
Added
- Accounts API is now available, this will allow you to access information about the Klaviyo account associated with your API key.
getAccounts
getAccount
Note: You will need to generate a new API key with either the Accounts
scope enabled or Full Access
to use these endpoints.
Changed
createProfile
- opts parameter removed because there are no optional query parameter that can be passed to the endpoint
Removed
- 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.
Klaviyo has the much lighter weight klaviyo.js
wrapper that we recommend for client-side use which you can read about here.
createClientEvent
createClientProfile
createClientSubscription
In addition, you can make client-side API calls outright if desired.
v3.0.0 - relationships and predictive analytivs
Added
-
Profiles API now returns predictive analytics when calling
getProfile
andgetProfiles
by passing inadditionalFieldsProfile = ["predictive_analytics"]
.const response = await Profiles.getProfiles({additionalFieldsProfile: ["predictive_analytics"]})
Changed
- Relationship endpoints that were previously grouped together are now split into related-resource-specific endpoints.
Migration Guide
- To migrate to this latest version, all calls to relationship endpoints need to be updated, as in the following example:
getCampaignRelationships(campaignId, "tags")
will becomegetCampaignRelationshipsTags(campaignId)
.