There are many references to shared libraries on this site. You can either take a copy of them or use them in place as you wish. I’m always hitting a few problems with a) versions b) keys


In Google Apps Script, in theory, if you use development mode, it will use the latest code in your library. If you turn it off, it will use whatever version of the library you choose. If there are other libraries linked to that library, then the same rules should apply. This makes it very hard to orchestrate shared libraries with lots of shared dependencies, when people can choose which ones they want to use (various version may work together, other may not).
I usually keep everything in development mode so it always picks up the latest versions until I’m ready to release, but when someone other than me is using one of my libraries, they only get the selected library version. All this gets fairly complicated when you have many libraries.

Library info

You’ll find this button appearing on some of my pages. It will return JSON describing the libraries and dependency info of all my public libraries.
In each of your libraries, add this function, substituting your dependent libraries if any, along with the library key, name and version. You can update that as you create new versions or additional dependencies. Since each of your dependent libraries will have this function too (as will the dependents of their dependents etc..), you’ll return a single object with info about all dependencies of all libraries as well as the versions currently being referenced.

Use it like this to get the profile of a list of libraries.

You’ll get this

I used to have a button on my pages that, upon being clicked, would give all keys and dependencies from the majority of my public libraries. This button doesn’t work anymore due to Gadgets having ceased to work.

I give you the code below should you want to adapt it for your own use

For more on snippets topics, see: