From faf9bade3dc00e7aa2d946d5e839f8654ea421c6 Mon Sep 17 00:00:00 2001 From: Devin Logan Date: Mon, 11 Aug 2025 14:40:16 -0400 Subject: [PATCH] expand env documentation in generators reference --- fern/products/fern-def/pages/auth.mdx | 2 +- fern/products/openapi-def/pages/auth.mdx | 2 +- .../reference/generators-yml-reference.mdx | 2 +- .../sdks/snippets/basic-auth-params.mdx | 19 ++++++++----------- .../sdks/snippets/bearer-auth-params.mdx | 4 ++-- .../sdks/snippets/header-auth-params.mdx | 4 ++-- fern/products/sdks/snippets/oauth-params.mdx | 8 ++++---- 7 files changed, 19 insertions(+), 22 deletions(-) diff --git a/fern/products/fern-def/pages/auth.mdx b/fern/products/fern-def/pages/auth.mdx index e75ebbbd4..d6ef9a7ce 100644 --- a/fern/products/fern-def/pages/auth.mdx +++ b/fern/products/fern-def/pages/auth.mdx @@ -3,7 +3,7 @@ title: Authentication subtitle: Model auth schemes such as bearer, basic, custom headers, and oauth. --- -Configuring authentication schemes happens in the `api.yml` file. +Configuring authentication schemes happens in the `api.yml` file. All Fern-generated SDKs support both direct configuration and environment variables for authentication credentials. ```bash {5} fern/ diff --git a/fern/products/openapi-def/pages/auth.mdx b/fern/products/openapi-def/pages/auth.mdx index 1f9ea850b..69d9f8990 100644 --- a/fern/products/openapi-def/pages/auth.mdx +++ b/fern/products/openapi-def/pages/auth.mdx @@ -3,7 +3,7 @@ title: Authentication subtitle: Model auth schemes such as bearer, basic, and api key. --- -Configuring authentication schemes happens in the `components.securitySchemes` section of OpenAPI. +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. ```yml title="openapi.yml" {2-3} components: diff --git a/fern/products/sdks/reference/generators-yml-reference.mdx b/fern/products/sdks/reference/generators-yml-reference.mdx index 1afc859f5..49c108261 100644 --- a/fern/products/sdks/reference/generators-yml-reference.mdx +++ b/fern/products/sdks/reference/generators-yml-reference.mdx @@ -333,7 +333,7 @@ api: local-generation: true ``` - + Protocol Buffers configuration. diff --git a/fern/products/sdks/snippets/basic-auth-params.mdx b/fern/products/sdks/snippets/basic-auth-params.mdx index e97917c0e..4acb7cd33 100644 --- a/fern/products/sdks/snippets/basic-auth-params.mdx +++ b/fern/products/sdks/snippets/basic-auth-params.mdx @@ -6,10 +6,10 @@ auth-schemes: scheme: basic username: name: "Username" - env: "BASIC_AUTH_USERNAME" + env: "BASIC_AUTH_USERNAME" # SDK will auto-scan this environment variable password: name: "Password" - env: "BASIC_AUTH_PASSWORD" + env: "BASIC_AUTH_PASSWORD" # SDK will auto-scan this environment variable ``` @@ -18,18 +18,15 @@ auth-schemes: Configuration for the username credential. - - A descriptive name for the username. - - - Environment variable name containing the username. + + 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"`. Configuration for the password credential. - - A descriptive name for the password. + + 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"`. - - Environment variable name containing the password. + + 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`. \ No newline at end of file diff --git a/fern/products/sdks/snippets/bearer-auth-params.mdx b/fern/products/sdks/snippets/bearer-auth-params.mdx index 42289dd0e..fd40356a9 100644 --- a/fern/products/sdks/snippets/bearer-auth-params.mdx +++ b/fern/products/sdks/snippets/bearer-auth-params.mdx @@ -6,7 +6,7 @@ auth-schemes: scheme: bearer token: name: "Access Token" - env: "BEARER_TOKEN" + env: "BEARER_TOKEN" # SDK will auto-scan this environment variable ``` @@ -19,5 +19,5 @@ auth-schemes: A descriptive name for the token. - Environment variable name containing the bearer token. + Environment variable name containing the bearer token. When specified, the generated SDK will automatically scan for this environment variable at initialization. \ No newline at end of file diff --git a/fern/products/sdks/snippets/header-auth-params.mdx b/fern/products/sdks/snippets/header-auth-params.mdx index 53fef8c70..dff74a66b 100644 --- a/fern/products/sdks/snippets/header-auth-params.mdx +++ b/fern/products/sdks/snippets/header-auth-params.mdx @@ -7,7 +7,7 @@ auth-schemes: header: "X-API-Key" type: "string" prefix: "ApiKey " - env: "MY_API_KEY" + env: "MY_API_KEY" # SDK will auto-scan this environment variable ``` @@ -23,5 +23,5 @@ auth-schemes: A prefix to prepend to the header value (e.g., `"Bearer "` or `"Token "`). - Environment variable name containing the authentication value. + Environment variable name containing the authentication value. When specified, the generated SDK will automatically scan for this environment variable at initialization. \ No newline at end of file diff --git a/fern/products/sdks/snippets/oauth-params.mdx b/fern/products/sdks/snippets/oauth-params.mdx index b605e92f7..f101392df 100644 --- a/fern/products/sdks/snippets/oauth-params.mdx +++ b/fern/products/sdks/snippets/oauth-params.mdx @@ -8,8 +8,8 @@ auth-schemes: scopes: - "read:users" - "write:users" - client-id-env: "OAUTH_CLIENT_ID" - client-secret-env: "OAUTH_CLIENT_SECRET" + client-id-env: "OAUTH_CLIENT_ID" # SDK will auto-scan this environment variable + client-secret-env: "OAUTH_CLIENT_SECRET" # SDK will auto-scan this environment variable token-prefix: "Bearer" token-header: "Authorization" get-token: @@ -42,10 +42,10 @@ auth-schemes: List of OAuth scopes to request during authentication. - Environment variable name containing the OAuth client ID. + Environment variable name containing the OAuth client ID. When specified, the generated SDK will automatically scan for this environment variable at initialization. - Environment variable name containing the OAuth client secret. + Environment variable name containing the OAuth client secret. When specified, the generated SDK will automatically scan for this environment variable at initialization. Sets the token header value prefix.