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

Asset Uploading with setVars

Open wkrause13 opened this issue 1 year ago • 1 comments

The documentation for uploading assets says to use setVars as follows:

FS.setVars('document', { assetMapId: 'ASSET_MAP_ID' });

However, this results in the following typescript error:

Argument of type '"document"' is not assignable to parameter of type '"page"'.ts

Is the documentation correct and should setVars support more values other than "page", or does the documentation need updating?

This was observed in version 1.7.1 of the browser sdk.

wkrause13 avatar Oct 06 '23 20:10 wkrause13

Hi there @wkrause13! Thanks for getting a ticket in with FullStory Support about this and sorry we hadn't seen this issue posted here. (We've added something on our end to notify us if new issues are added so we won't miss any new issues in the future. 🙂)

Just following up with the answer we shared in that ticket, in case other folks find this issue and are curious about the answer.

In version 1.7.1 it was the case that the FS.setVars call only accepted a string value of page for the scope (see 'Note' at the bottom of the page here).

However, we released 2.0.0 version of the browser SDK which added support for asset uploading, so we would recommend you update to version 2.0.0 and add the configuration in your FS initialization as the assetMapId (see here).

Alternatively, if you're not looking to update to version 2.0.0, you should be able to set the global variable before you initialize FullStory as shown here:

window['_fs_asset_map_id'] = 'ASSET_MAP_ID';
FullStory.init(...);

1etoy avatar Oct 27 '23 22:10 1etoy