I have a website created by sites.google.com. Using Embed option, I would like to use Google Calendar API to display calendar events (we have specific format requirements that the default Calendar option does not provide). When I try my javascript code from localhost:8000, I am able to display the calendar events. However, when I put the code (basically identical to the javascript quickstart https://developers.google.com/calendar/api/quickstart/js) in my website in sites.google.com, I get an error "Not a valid origin for the client: https://1737011456-atari-embeds.googleusercontent.com has not been registered". I tried to add googleusercontent.com as allowed origin, but I get "Invalid Origin: uses a forbidden domain" error.
How can I use Google Calendar API on Google Sites?
I decided to go against Apps Script. Firefox blocks the embedded website by default and there were other complications I wasn't too happy about.
This was the alternative approach I found online. Replace the CALENDAR_ID and API_KEY and you'll get the public events from the given calendar if you have the api key to access it: https://www.googleapis.com/calendar/v3/calendars/CALENDAR_ID/events?key=API_KEY