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

When an env variable is used for the API key, include it in the SDK docs #6206

Open
jcbwndsr opened this issue Feb 27, 2025 · 0 comments
Open

Comments

@jcbwndsr
Copy link

jcbwndsr commented Feb 27, 2025

Which Fern component?

SDK Generator

How important is this?

P0 - Critical (Blocking work)

What's the feature?

Feature Include env variable usage in the API key docs
Why? So that users of the generated SDK know that they can use the docs

Description
Now, when an environment variable is allowed for setting the client, API key, it is undocumented in the generated README.

generators.yml

...
auth-schemes:
  ApiKeyAuthScheme:
    header: X-API-Key
    type: string
    name: apiKey
    env: PLANTS_API_KEY  
...

resulting README.md:

from axiomatic import Axiomatic, UserRequirement

client = Axiomatic(
    api_key="YOUR_API_KEY",
)

Suggested README addition to "usage" section

### Environment Variable
You may also set the API key via an environment variable:

```python
from axiomatic import Axiomatic, UserRequirement
import os

os.environ["PLANTS_API_KEY"] = "YOUR_API_KEY"

client = Axiomatic()

Are you interested in contributing this feature?

Can do!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant