API Reference

@frontend-sdk/klaviyo - v0.24.2

Functions

identifyUser

identifyUser(userData): number

Parameters

NameType
userDataKlaviyoIdentify

Returns

number


subscribeToBackInStock

subscribeToBackInStock(__namedParameters): Promise<Response>

Parameters

NameType
__namedParametersProps

Returns

Promise<Response>


trackAddedToCart

trackAddedToCart(product): number

Parameters

NameType
productKlaviyoProduct

Returns

number


trackEvent

trackEvent(eventName, eventData): number

Parameters

NameType
eventNamestring
eventDataobject

Returns

number


trackRecentlyViewedItem

trackRecentlyViewedItem(product): number

Parameters

NameType
productKlaviyoProduct

Returns

number


trackVisitedProduct

trackVisitedProduct(product): void

Parameters

NameType
productKlaviyoProduct

Returns

void


useKlaviyo

useKlaviyo(siteId): void

Parameters

NameType
siteIdstring

Returns

void


useKlaviyoForceReload

useKlaviyoForceReload(siteId): void

This is a special hook that sets two variables (klaviyoModulesObject and klFormsObject) to be configurable.
With that, we can reset them (delete).
If we reset them, then Klaviyo's script on load will find divs for embedded form and extend them with forms designed in Klaviyo app.
Klaviyo script sets them configurable: false. So we need to set them to true before script load.

Parameters

NameType
siteIdstring

Returns

void


Did this page help you?