Secure Form Encryption
Updated
To implement secure form encryption, you can use the following SDK information.
This SDK allows you to subscribe to external callback events and implement encryption for secure forms according to your specific requirements.
function handleSecureFormEncryption({ response: { data }, cb) => {
/*
* data: {
* actionId: string; // configure it in submit button to uniquely identify which form is submitted
* actionPayload: {
* fields: {}; // all configured field come here
* values: {}; // map of fieldName vs values
* },
* contextId: string; // conversationId
* }
*/
if (data) {
// here run the encryption logic & then call callback with
required structure
// if encryption is run successfully then call with -
cb({
encryptedData: {
// map of fieldName vs encrypted values
},
unencryptedData: {
// map of fieldName vs unencrypted values
// values that are not being encrypted should be
// returned as it is
}
});
// if encryption is failed then call with -
cb(null, error);
}
}
sprChat('subScriberToUpdate', {
topic: 'externalCallback',
subscriber: handleSecureFormEncryption,
});
You should implement the handleSecureFormEncryption function to manage secure form encryption. The function takes a response object and a callback function as parameters.
Unencrypted Data in SDK
Utilize the fieldName parameter to pass values.
This data will be visible in Care Console if the "show data" option is used.
Encrypted Data in SDK
You can create a new fieldName and pass it along with its values.
Encrypted data will not be visible in Care Console even when the "show data" option is used.