I am trying to deploy a google sheet add on (private add on.) I am using moment js for calculating the date in my code.js file
My manifest looks like this
Manifest:
When I go to deploy the add on I am getting the error
"An explicit urlFetchWhitelist is required for all Google Workspace add-ons using UrlFetchApp"
I went through the posts on stackoverflow for the same and i did three recommended changes
Still I am getting the same error when I go and click on deploy add on
urlFetchWhitelist error:
You need to add a urlFetchWhitelist
parameter to your manifest and include all urls that you wish to fetch in an array as its value.
Say you have the line:
const res = UrlFetchApp.fetch("https://google.com")
in your code.
You will need to add this to the whitelist in the appsscript.json
manifest file:
urlFetchWhitelist: ["https://google.com/"]
Things to note (from the documentation):
https://
, not http://
.https://www.google.com/
is valid but https://www.google.com
is not.addOns.common.openLinkUrlPrefixes
field to match all links, but this is not recommended as it can expose a user's data to risk and can prolong the add-on review process. Only use a wildcard if your add-on functionality requires it.As per information on this Issue Tracker report, only the domain/sub-domain needs to whitelisted for fetching.
For example, whitelisting:
"urlFetchWhitelist": ["https://myapp.com/"]
Will allow UrlFetchApp
to connect to paths on that domain:
UrlFetchApp.fetch("https://myapp.com/getUser")