Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support setting client_id and api_key as class variables #165

Closed
castrapel opened this issue Nov 25, 2022 · 1 comment · Fixed by #339
Closed

support setting client_id and api_key as class variables #165

castrapel opened this issue Nov 25, 2022 · 1 comment · Fixed by #339
Labels
enhancement New feature or request
Milestone

Comments

@castrapel
Copy link

Currently, Python SDK users need to monkeypatch WorkOS SDK by setting a client_id and api_key at the module level. This is an anti-pattern because the object's definition doesn't describe how it actually behaves. A better practice would be the ability to pass in api_key and client_id when instantiating a client. An example:

import workos
workos_client = workos.client(api_key, client_id)

or

import workos
workos_client = workos.client
workos_client.api_key = "..."
workos_client.client_id = "..."

Although we can set the class variables today, workos needs them set at the module level:

image

@maxdeviant
Copy link
Contributor

This sounds like a good improvement!

We'll see where it sits on the SDK roadmap.

@maxdeviant maxdeviant added the enhancement New feature or request label Apr 24, 2023
@PaulAsjes PaulAsjes added this to the v5.0.0 milestone Jul 8, 2024
@mattgd mattgd mentioned this issue Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

3 participants