feat: Custom Attributes for contacts (#1158)
Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
This commit is contained in:
parent
507b40a51d
commit
cdd385b269
18 changed files with 182 additions and 21 deletions
|
@ -32,6 +32,24 @@ const runSDK = ({ baseUrl, websiteToken }) => {
|
|||
}
|
||||
},
|
||||
|
||||
setCustomAttributes(customAttributes = {}) {
|
||||
if (!customAttributes || !Object.keys(customAttributes).length) {
|
||||
throw new Error('Custom attributes should have atleast one key');
|
||||
} else {
|
||||
IFrameHelper.sendMessage('set-custom-attributes', { customAttributes });
|
||||
}
|
||||
},
|
||||
|
||||
deleteCustomAttribute(customAttribute = '') {
|
||||
if (!customAttribute) {
|
||||
throw new Error('Custom attribute is required');
|
||||
} else {
|
||||
IFrameHelper.sendMessage('delete-custom-attribute', {
|
||||
customAttribute,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
setLabel(label = '') {
|
||||
IFrameHelper.sendMessage('set-label', { label });
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue