Global Variable apiKey
Please remove the dependency on the global variable apiKey. This implementation makes it very difficult to write concurrent code that leverages multiple api keys. If you're writing anything that's going to be used by multiple clients, this is a really unfortunate restriction of the library. Thanks for your consideration.
Russell
That's a good point, and it's why all of our API calls allow you to specify an API key directly to them as an optional extra argument, which overrides the globally set API key. However, in the vast majority of cases, our users only have a single active API key at a time, so it would be pretty silly if we required them to pass it to every single API call.
all of our API calls allow you to specify an API key directly to them as an optional extra argument, which overrides the globally set API key
@ebroder is it the case for the Java SDK? what is the syntax to pass the API key?
@Zhen-hao We document it on our readme here: https://github.com/stripe/stripe-java#per-request-configuration
Thank you very much! This saved me!
On Tue, Jun 29, 2021 at 4:50 PM remi-stripe @.***> wrote:
@Zhen-hao https://github.com/Zhen-hao We document it on our readme here: https://github.com/stripe/stripe-java#per-request-configuration
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stripe/stripe-java/issues/18#issuecomment-870668341, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACTTDCZNFKCHYXKF5IXTWCDTVHMSHANCNFSM4AB2OMPQ .