Skip to content

Conversation

@alicejli
Copy link
Contributor

Fixes #10921

This adds the current workaround for manually setting the API Key in the header when instantiating a client.

@alicejli alicejli requested a review from a team as a code owner July 22, 2024 19:40
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Jul 22, 2024
@alicejli alicejli requested a review from blakeli0 July 24, 2024 13:41
We are actively exploring ways to improve the API Key experience.
Currently, to use an API Key with a Java client library, you need to set the header for the relevant service Client manually.
For example, to set the API Key with the [Language service](https://cloud.google.com/java/docs/reference/google-cloud-language/latest/overview):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do Language support API Keys?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, it does.

Co-authored-by: Blake Li <blakeli@google.com>
@alicejli alicejli merged commit b12223f into main Jul 26, 2024
@alicejli alicejli deleted the addAPIKeyDocs branch July 26, 2024 21:20
lqiu96 pushed a commit that referenced this pull request Jul 7, 2025
* docs: add sample code for authenticating with api keys

* Update README.md

Co-authored-by: Blake Li <blakeli@google.com>

---------

Co-authored-by: Blake Li <blakeli@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add guides for how to set API Keys

2 participants