I've created a project bounded to a spreadsheet in Google Apps Script and I'm thinking of creating more in other applications.
I don't want contributors to my spreadsheets or other app script containers to be able to view my project code. I just want them to be able to execute them.
As I understand from the following, posting the code as a library doesn't help as read access is required for it to be added to the project and run.
From Collaborating with Other Developers :
Sharing and libraries
Libraries included in your project are shared with project collaborators. Though, if they do not have at least read-level access to an included library they are unable to use those libraries and will encounter an error if they attempt to do so. For more information about libraries, see Managing Libraries .
How can I block view access to the code?
I have consulted the documentation indicated in references but I cannot find how to block the display of the code to the collaborators of the containers (spreadsheets, documents, forms).
References
Short answer
It is not possible to block the display of code in bounded scripts.
wide answer
As mentioned in the question, the use of libraries (libraries) requires access to at least read only, otherwise trying to execute functions that depend on the library will show an error. Workarounds may vary depending on the type and characteristics of the code. By type I mean whether it is a custom spreadsheet function, usually just called a custom function, a function that is triggered by a menu or an event.
An alternative is to create an add-on. Details at Develop Add-ons for Google Sheets, Documents and Forms .
Note that plugins can be restricted to be used by users from the same domain as the developer,
Google Apps for WorkG Suite is required. For details, see https://developers.google.com/apps-script/add-ons/publish .Another alternative that might work in certain cases is to create a web application that can be called from the spreadsheet, for example by using a plugin like Bloqkspring .