Skip to content

Commit faf9bad

Browse files
committed
expand env documentation in generators reference
1 parent 5aafee6 commit faf9bad

File tree

7 files changed

+19
-22
lines changed

7 files changed

+19
-22
lines changed

fern/products/fern-def/pages/auth.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Authentication
33
subtitle: Model auth schemes such as bearer, basic, custom headers, and oauth.
44
---
55

6-
Configuring authentication schemes happens in the `api.yml` file.
6+
Configuring authentication schemes happens in the `api.yml` file. All Fern-generated SDKs support both direct configuration and environment variables for authentication credentials.
77

88
```bash {5}
99
fern/

fern/products/openapi-def/pages/auth.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Authentication
33
subtitle: Model auth schemes such as bearer, basic, and api key.
44
---
55

6-
Configuring authentication schemes happens in the `components.securitySchemes` section of OpenAPI.
6+
Configuring authentication schemes happens in the `components.securitySchemes` section of OpenAPI. All Fern-generated SDKs support both direct configuration and environment variables for authentication credentials.
77

88
```yml title="openapi.yml" {2-3}
99
components:

fern/products/sdks/reference/generators-yml-reference.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ api:
333333
local-generation: true
334334
```
335335

336-
<ParamField path="sproto" type="ProtobufDefinitionSchema" required={true} toc={true}>
336+
<ParamField path="proto" type="ProtobufDefinitionSchema" required={true} toc={true}>
337337
Protocol Buffers configuration.
338338
</ParamField>
339339

fern/products/sdks/snippets/basic-auth-params.mdx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ auth-schemes:
66
scheme: basic
77
username:
88
name: "Username"
9-
env: "BASIC_AUTH_USERNAME"
9+
env: "BASIC_AUTH_USERNAME" # SDK will auto-scan this environment variable
1010
password:
1111
name: "Password"
12-
env: "BASIC_AUTH_PASSWORD"
12+
env: "BASIC_AUTH_PASSWORD" # SDK will auto-scan this environment variable
1313
```
1414
1515
<ParamField path="scheme" type="'basic'" required={true}>
@@ -18,18 +18,15 @@ auth-schemes:
1818
<ParamField path="username" type="object" required={false}>
1919
Configuration for the username credential.
2020
</ParamField>
21-
<ParamField path="name" type="string" required={false}>
22-
A descriptive name for the username.
23-
</ParamField>
24-
<ParamField path="env" type="string" required={false}>
25-
Environment variable name containing the username.
21+
<ParamField path="username.name" type="string" required={false}>
22+
Custom parameter name for the username in the generated SDK. If not specified, defaults to `"username"`. Use this to provide more descriptive or domain-specific parameter names like `"clientId"`, `"userEmail"`, or `"merchantId"`.
2623
</ParamField>
2724
<ParamField path="password" type="object" required={false}>
2825
Configuration for the password credential.
2926
</ParamField>
30-
<ParamField path="name" type="string" required={false}>
31-
A descriptive name for the password.
27+
<ParamField path="password.name" type="string" required={false}>
28+
Custom parameter name for the password in the generated SDK. If not specified, defaults to `"password"`. Use this to provide more descriptive or domain-specific parameter names like `"clientSecret"`, `"apiKey"`, or `"merchantKey"`.
3229
</ParamField>
33-
<ParamField path="env" type="string" required={false}>
34-
Environment variable name containing the password.
30+
<ParamField path="username.env, password.env" type="string" required={false}>
31+
Environment variable name that the SDK will automatically scan for the username or password value. When this environment variable is present, users don't need to explicitly provide the username parameter. Follow naming conventions like `YOUR_APP_USERNAME` or `SERVICE_CLIENT_ID`.
3532
</ParamField>

fern/products/sdks/snippets/bearer-auth-params.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ auth-schemes:
66
scheme: bearer
77
token:
88
name: "Access Token"
9-
env: "BEARER_TOKEN"
9+
env: "BEARER_TOKEN" # SDK will auto-scan this environment variable
1010
```
1111
1212
<ParamField path="scheme" type="'bearer'" required={true}>
@@ -19,5 +19,5 @@ auth-schemes:
1919
A descriptive name for the token.
2020
</ParamField>
2121
<ParamField path="token.env" type="string" required={false}>
22-
Environment variable name containing the bearer token.
22+
Environment variable name containing the bearer token. When specified, the generated SDK will automatically scan for this environment variable at initialization.
2323
</ParamField>

fern/products/sdks/snippets/header-auth-params.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ auth-schemes:
77
header: "X-API-Key"
88
type: "string"
99
prefix: "ApiKey "
10-
env: "MY_API_KEY"
10+
env: "MY_API_KEY" # SDK will auto-scan this environment variable
1111
```
1212
1313
<ParamField path="header" type="string" required={true}>
@@ -23,5 +23,5 @@ auth-schemes:
2323
A prefix to prepend to the header value (e.g., `"Bearer "` or `"Token "`).
2424
</ParamField>
2525
<ParamField path="env" type="string" required={false}>
26-
Environment variable name containing the authentication value.
26+
Environment variable name containing the authentication value. When specified, the generated SDK will automatically scan for this environment variable at initialization.
2727
</ParamField>

fern/products/sdks/snippets/oauth-params.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ auth-schemes:
88
scopes:
99
- "read:users"
1010
- "write:users"
11-
client-id-env: "OAUTH_CLIENT_ID"
12-
client-secret-env: "OAUTH_CLIENT_SECRET"
11+
client-id-env: "OAUTH_CLIENT_ID" # SDK will auto-scan this environment variable
12+
client-secret-env: "OAUTH_CLIENT_SECRET" # SDK will auto-scan this environment variable
1313
token-prefix: "Bearer"
1414
token-header: "Authorization"
1515
get-token:
@@ -42,10 +42,10 @@ auth-schemes:
4242
List of OAuth scopes to request during authentication.
4343
</ParamField>
4444
<ParamField path="client-id-env" type="string" required={false}>
45-
Environment variable name containing the OAuth client ID.
45+
Environment variable name containing the OAuth client ID. When specified, the generated SDK will automatically scan for this environment variable at initialization.
4646
</ParamField>
4747
<ParamField path="client-secret-env" type="string" required={false}>
48-
Environment variable name containing the OAuth client secret.
48+
Environment variable name containing the OAuth client secret. When specified, the generated SDK will automatically scan for this environment variable at initialization.
4949
</ParamField>
5050
<ParamField path="token-prefix" type="string" default="Bearer">
5151
Sets the token header value prefix.

0 commit comments

Comments
 (0)