fullstory-browser-sdk icon indicating copy to clipboard operation
fullstory-browser-sdk copied to clipboard

Provide A Way To Manipulate Payloads Before Sending Them To FullStory Using A Callback

Open Zozman opened this issue 3 years ago • 1 comments

Problem

Currently there seems to be no way to manipulate information collected by FullStory on the client before it is sent to FullStory (particularly the network calls). If you waned to do something like sensor any value matching a Regex or remove a particular piece of data before it's sent off (like removing IP addresses or something), you can't.

Proposal

Provide a callback that allows access to the payload before it is sent that can be used to manipulate the payload before it leaves the client (Sentry for example provides a very easy to use beforeSend hook in their SDK just for this purpose).

Proposed Example Syntax

window['_fs_before_send'] = function(payload) {
     // Here manipulate the payload object as needed
     // For example, if there is an ip here, remove it
     delete payload.ip;
     // Then return the object and the SDK can then send it
     return payload;
};

Zozman avatar Nov 19 '21 22:11 Zozman

Hi there! Thanks for the suggestion! In general, this repository exists purely as a way to utilize the FullStory Client API via an npm package. Because of that, this isn't the correct venue for feature suggestions on that API. Such requests would be more useful directed at FullStory Customer Support, who can ensure that it's brought to the attention of the relevant development team internally.

That being said, I can tell you that there is in-progress work to implement something very similar to what you've requested here. When that work hits general availability I'll update this issue with more details.

luser avatar Jun 13 '22 17:06 luser

When that work hits general availability I'll update this issue with more details.

@luser any update on that feature availability? We would love to be able to standardize around a callback like beforeSend as we use both Datadog and Sentry which have that mechanism.

timoteialbu avatar Sep 26 '24 18:09 timoteialbu