I am using a fetch within a code injection to get some events data to show on my Squarespace site. The code for the fetch is working and returns a response which I am able to display.
The fetch looks like this
let response = fetch(
"https://api.seatgeek.com/2/events?per_page=100&venue.city=boston&client_id=MYAPIKEY"
)
.then((response) => //...
What is the best practice for keeping MYAPIKEY safe and accessible within a Squarespace site?
My first guess is that I will have to create a new unlinked and password-protected page, create a new code injection there, then somehow link to that page during the API call - but I'm not sure if that is truly secure.
Thanks for your help!