We have a headless website with a front end based on a Next.js starter template. We use connected GraphQL calls for certain search and filter functionalities, allowing users to interact with the site (e.g., filtering), and we retrieve the results via GraphQL.
Since these calls are client-side, the API key is exposed in the request headers, as shown below.
The following screenshot is from local development.
Screenshot: GraphQL endpoint from the environment file.
Screenshot: Issue – API key is exposed in the request headers.




