How to get Storefront API key with javascript?

I’m an app developer and to be able to use graphql queries I need this API key from my clients stores.

So how can I get this key with javascript? Is this key meant to be retrieved on frontend, or is it more like backend related work? I read the docs but still confused.