google-apps-scriptdeploymentshared-librarieslibraries

Issues Publishing and Versioning Google Apps Script Library


I'm working with Google Apps Script and trying to set up a library that I can use across different projects. I've successfully published the library and can connect to it from other scripts, but I'm encountering a couple of issues:

  1. Development Mode Display: When connecting to the library from another script, it shows not only the version but also the "Head" (development mode). I want to ensure that users only see the published version and not the development mode. How can I configure it so that only the official version is visible?
  2. Library Identifier: I’m unable to set a library identifier through the publishing process. It seems that only the user who deploys the library can set an identifier. I would prefer to have a consistent identifier for the library that doesn’t depend on individual users. Is there a way to set or manage a stable identifier for a published library?

Any guidance or solutions to these issues would be greatly appreciated. Thanks!


Solution

  • TL;DR:

    1. Development Mode Display:

      How can I configure it so that only the official version is visible?

      Not possible.

    2. Library Identifier

      Is there a way to set or manage a stable identifier for a published library?

      You can use the desired identifier as the project title.


    Development Mode Display

    When an Apps Script project is deployed as a library, it should be shared with others to make it available to them. The option most restrictive is to share it as view-only. This option doesn't list the Head deployment in the version selector. However, the Head deployment code could be found using the library "open in new tab" URL by replacing the version number with 0 even for libraries shared as view-only.

    A deployed project as a library will show something like the following for the Head deployment:

    Untitled project (version 0)

    Head

    myFunction()

    Please note the word Head below the top heading.

    Library Identifier

    Spaces and other unsupported characters will be trimmed and changed to Title case. Consider this when choosing the library default identifier.