How to use API key in AJAX call?

Isn’t this going to expose your All Users API Key to everyone who can view your site? I think you’ll need to find another approach for getting the group data from a theme component.