Expand my Community achievements bar.

SOLVED

How to import Adobe Launch Extension version into lib/actions JS file?

Avatar

Level 2

In the code which will exist in runtime on the site, how do I get the version of the extension so we can send it with requests we will do from the client side browser?

 

ugobey_1-1688028591232.png

Is there perhaps a way to get it from the Adobe Extension UI first?

By extension version I mean the version in the extension.json file of the package

ugobey_2-1688028603970.png

Thanks

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Oh ok, getting the version number from within your own extension.

Unfortunately, I haven't been able to find a way to do so either. (I too am a developer of a few public extensions, like YouTube Playback and Web Vitals.) I normally have my own constant variable in my code to store my version number. Of course, that means I have to remember to update the version number in various places every time.

If you do find a way to use the version number in extension.json, please share the solution here! 

View solution in original post

3 Replies

Avatar

Community Advisor

Unfortunately, no. Unless the developer has purposely made the version available, e.g. through a data element that the extension provides, you simply can't get the version number of an extension anywhere.

As a workaround, you can track the Environment Build Date and Time to an eVar. Then use that to match back to the extension versions that are used in that library.

Avatar

Level 2

Hello,

I am the developer of our own extension. I am not asking about how to access the version from other extensions, I showed the code itself of the extension and the extension JSON file. 

I am asking how do I get that version number from the extension JSON file to be available to read in our extension?

Thanks

Avatar

Correct answer by
Community Advisor

Oh ok, getting the version number from within your own extension.

Unfortunately, I haven't been able to find a way to do so either. (I too am a developer of a few public extensions, like YouTube Playback and Web Vitals.) I normally have my own constant variable in my code to store my version number. Of course, that means I have to remember to update the version number in various places every time.

If you do find a way to use the version number in extension.json, please share the solution here!