unsubscribeByMarker
Unsubscribe from events to products. 🔐 This method requires authorization.
Description
This method unsubscribes the authorized user from an event subscription on a specific product. It returns a Promise that resolves to true if the subscription was removed, or an IError object if there was an issue.
⚠️ With the default
errors.isShell: truesetting, a rejected request is returned rather than thrown: this method resolves to anIErrorobject, never tofalse. Checkresult === true- an error object is truthy, soif (result)would treat a failure as success.
Events.unsubscribeByMarker(
marker*,
productId*,
langCode,
threshold
);
Parameters schema
Schema
marker:* string
Event marker
example: test_event
productId:* string
Product id
example: 14
langCode: string
Language code
example: en_US
threshold: number
Threshold value for comparing numerical value
example: 0
Examples
Minimal example
const response = await Events.unsubscribeByMarker('test_event', 1);
Example with attributes
const response = await Events.unsubscribeByMarker('test_event', 1, 'en_US', 0);
Returns nothing if the unsubscription was successful.