plugins – How to pass the API key to the client from the database?


I wrote this simple client in javascript that uses mapbox geocoding API. It is not necessary to hide the API key but what is the correct way of giving that js file access to the API key without hardcoding it?

Is it a good solution to embed the API key in the html file in a hidden div and have js read it from that div?

Dangz1 1 year 2021-08-09T16:21:41-05:00 0 Answers 0 views 0

Leave an answer