From 03bee3c69da2d4202d63dc00439ee74b64ae6763 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 5 Aug 2026 17:09:08 +0000 Subject: [PATCH 1/2] docs: document allowUserAgentAppInfo for Go, C#, Java, Ruby, and PHP SDKs Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../sdks/generators/csharp/configuration.mdx | 19 +++++++++++++++++++ .../sdks/generators/go/configuration.mdx | 19 +++++++++++++++++++ .../sdks/generators/java/configuration.mdx | 19 +++++++++++++++++++ .../sdks/generators/php/configuration.mdx | 18 ++++++++++++++++++ .../sdks/generators/ruby/configuration.mdx | 19 +++++++++++++++++++ 5 files changed, 94 insertions(+) diff --git a/fern/products/sdks/generators/csharp/configuration.mdx b/fern/products/sdks/generators/csharp/configuration.mdx index b440858a6d..45bb96bdb0 100644 --- a/fern/products/sdks/generators/csharp/configuration.mdx +++ b/fern/products/sdks/generators/csharp/configuration.mdx @@ -99,6 +99,25 @@ When enabled, the generated SDK omits the `X-Fern-Language`, `X-Fern-SDK-Name`, When enabled, the generated SDK sends a single structured `User-Agent` header of the form `{sdkName}/{version} ({os}; {arch}) {runtime}/{runtimeVersion}` (for example, `my-sdk/1.2.0 (linux; x86_64) dotnet/8.0.4`), carrying SDK, operating system, architecture, and runtime information in place of the default `User-Agent` and discrete platform headers. If `omit-fern-headers` is enabled, no `User-Agent` or platform headers are sent and this option has no effect. + +When enabled, the generated SDK emits an `AppInfo` record with a required `Name` and optional `Version` and `Comment`, and exposes it as an `AppInfo` property on `ClientOptions`. Its product token is appended to the `User-Agent` header, which lets an application built on the SDK identify itself to the API, following the [HTTP `User-Agent` grammar](https://www.rfc-editor.org/rfc/rfc9110#name-user-agent). + +```csharp +var client = new AcmeApiClient("...", new ClientOptions +{ + AppInfo = new AppInfo { Name = "partner-app", Version = "3.1.0", Comment = "+https://partner.example" } +}); +``` + +The token is formatted as `{Name}/{Version} ({Comment})`, dropping `/{Version}` and `({Comment})` when blank, and is appended to whatever `User-Agent` the SDK would otherwise send, including the structured header from [`include-platform-headers`](#include-platform-headers): + +``` +User-Agent: my-sdk/1.2.0 (linux; x86_64) dotnet/8.0.4 partner-app/3.1.0 (+https://partner.example) +``` + +Caller-supplied values are sanitized before they reach the header. An explicit `User-Agent` header takes precedence, the header is unchanged when no `AppInfo` is set, and [`omit-fern-headers`](#omit-fern-headers) suppresses it entirely. + + Sets the NuGet package identifier for the generated SDK. This is used when publishing the SDK to NuGet or other package repositories. diff --git a/fern/products/sdks/generators/go/configuration.mdx b/fern/products/sdks/generators/go/configuration.mdx index e480de85fa..d50d84fa4b 100644 --- a/fern/products/sdks/generators/go/configuration.mdx +++ b/fern/products/sdks/generators/go/configuration.mdx @@ -58,6 +58,25 @@ When enabled, the generated SDK omits the `X-Fern-Language`, `X-Fern-SDK-Name`, When enabled, the generated SDK sends a single structured `User-Agent` header of the form `{sdkName}/{version} ({os}; {arch}) {runtime}/{runtimeVersion}` (for example, `my-sdk/0.0.1 (linux; x86_64) Go/1.22.0`), carrying SDK, operating system, architecture, and runtime information in place of the default `User-Agent` and discrete platform headers. If `omitFernHeaders` is enabled, no `User-Agent` or platform headers are sent and this option has no effect. + +When enabled, the generated SDK exposes an `option.WithUserAgentAppInfo(name, version, comment)` option, with a required name and optional version and comment (pass `""` to omit either). Its product token is appended to the `User-Agent` header, which lets an application built on the SDK identify itself to the API, following the [HTTP `User-Agent` grammar](https://www.rfc-editor.org/rfc/rfc9110#name-user-agent). + +```go +client := acmeclient.NewClient( + option.WithToken("..."), + option.WithUserAgentAppInfo("partner-app", "3.1.0", "+https://partner.example"), +) +``` + +The token is formatted as `{name}/{version} ({comment})`, dropping `/{version}` and `({comment})` when blank, and is appended to whatever `User-Agent` the SDK would otherwise send, including the structured header from [`includePlatformHeaders`](#includePlatformHeaders): + +``` +User-Agent: my-sdk/0.0.1 (linux; x86_64) Go/1.22.0 partner-app/3.1.0 (+https://partner.example) +``` + +Caller-supplied values are sanitized before they reach the header. An explicit `User-Agent` header takes precedence, the header is unchanged when no name is passed, and [`omitFernHeaders`](#omitFernHeaders) suppresses it entirely. + + Generates [mock server (wire) tests](/sdks/deep-dives/testing#mock-server-tests) to verify that the SDK sends the correct HTTP requests and correctly handles responses per the API spec. When enabled, Docker is required as a runtime dependency to run the generated tests. diff --git a/fern/products/sdks/generators/java/configuration.mdx b/fern/products/sdks/generators/java/configuration.mdx index 1e8cb8e54f..3e746e1287 100644 --- a/fern/products/sdks/generators/java/configuration.mdx +++ b/fern/products/sdks/generators/java/configuration.mdx @@ -117,6 +117,25 @@ When enabled, the generated SDK omits the `X-Fern-Language`, `X-Fern-SDK-Name`, When enabled, the generated SDK sends a single structured `User-Agent` header of the form `{sdkName}/{version} ({os}; {arch}) {runtime}/{runtimeVersion}` (for example, `com.fern.sdk/0.0.1 (linux; x86_64) Java/17.0.13`), carrying SDK, operating system, architecture, and runtime information in place of the default `User-Agent` and discrete platform headers. If `omit-fern-headers` is enabled, no `User-Agent` or platform headers are sent and this option has no effect. + +When enabled, the generated client builder exposes an `appInfo(String name, String version, String comment)` method, with a required name and optional version and comment (pass `null` to omit either). Its product token is appended to the `User-Agent` header, which lets an application built on the SDK identify itself to the API, following the [HTTP `User-Agent` grammar](https://www.rfc-editor.org/rfc/rfc9110#name-user-agent). + +```java +AcmeApiClient client = AcmeApiClient.builder() + .token("...") + .appInfo("partner-app", "3.1.0", "+https://partner.example") + .build(); +``` + +The token is formatted as `{name}/{version} ({comment})`, dropping `/{version}` and `({comment})` when blank, and is appended to whatever `User-Agent` the SDK would otherwise send, including the structured header from [`includePlatformHeaders`](#includePlatformHeaders) and the version resolved by [`runtime-version`](#runtime-version): + +``` +User-Agent: com.fern.sdk/0.0.1 (linux; x86_64) Java/17.0.13 partner-app/3.1.0 (+https://partner.example) +``` + +Caller-supplied values are sanitized before they reach the header. An explicit `User-Agent` header takes precedence, the header is unchanged when no name is passed, and [`omit-fern-headers`](#omit-fern-headers) suppresses it entirely. + + Determines the organization of generated Java packages. Choose 'nested' for a hierarchical package structure that mirrors your API organization, or 'flat' for a simpler structure with fewer nested packages. diff --git a/fern/products/sdks/generators/php/configuration.mdx b/fern/products/sdks/generators/php/configuration.mdx index b330555d07..9369fb7c27 100644 --- a/fern/products/sdks/generators/php/configuration.mdx +++ b/fern/products/sdks/generators/php/configuration.mdx @@ -61,6 +61,24 @@ When enabled, the generated SDK omits the `X-Fern-Language`, `X-Fern-SDK-Name`, When enabled, the generated SDK sends a single structured `User-Agent` header of the form `{sdkName}/{version} ({os}; {arch}) {runtime}/{runtimeVersion}` (for example, `my-sdk/0.0.1 (linux; x86_64) PHP/8.2.0`), carrying SDK, operating system, architecture, and runtime information in place of the default `User-Agent` and discrete platform headers. If `omitFernHeaders` is enabled, no `User-Agent` or platform headers are sent and this option has no effect. + +When enabled, the generated client accepts an optional `appInfo` client option of the shape `array{name: string, version?: string, comment?: string}`. Its product token is appended to the `User-Agent` header, which lets an application built on the SDK identify itself to the API, following the [HTTP `User-Agent` grammar](https://www.rfc-editor.org/rfc/rfc9110#name-user-agent). + +```php +$client = new AcmeClient('...', [ + 'appInfo' => ['name' => 'partner-app', 'version' => '3.1.0', 'comment' => '+https://partner.example'], +]); +``` + +The token is formatted as `{name}/{version} ({comment})`, dropping `/{version}` and `({comment})` when blank, and is appended to whatever `User-Agent` the SDK would otherwise send, including the structured header from [`includePlatformHeaders`](#includePlatformHeaders): + +``` +User-Agent: my-sdk/0.0.1 (linux; x86_64) PHP/8.2.0 partner-app/3.1.0 (+https://partner.example) +``` + +Caller-supplied values are sanitized before they reach the header. An explicit `User-Agent` header takes precedence, the header is unchanged when no `appInfo` is passed, and [`omitFernHeaders`](#omitFernHeaders) suppresses it entirely. + + Sets the name of the PHP package as it will appear in Composer and Packagist. This is the name users will use to install the SDK via Composer (e.g., `composer require your/package-name`). diff --git a/fern/products/sdks/generators/ruby/configuration.mdx b/fern/products/sdks/generators/ruby/configuration.mdx index 5367712ed8..cc7bbd6ae8 100644 --- a/fern/products/sdks/generators/ruby/configuration.mdx +++ b/fern/products/sdks/generators/ruby/configuration.mdx @@ -104,6 +104,25 @@ When enabled, the generated SDK omits the `X-Fern-Language`, `X-Fern-SDK-Name`, When enabled, the generated SDK sends a single structured `User-Agent` header of the form `{sdkName}/{version} ({os}; {arch}) {runtime}/{runtimeVersion}` (for example, `my-sdk/0.0.1 (linux; x86_64) Ruby/3.2.0`), carrying SDK, operating system, architecture, and runtime information in place of the default `User-Agent` and discrete platform headers. If `omitFernHeaders` is enabled, no `User-Agent` or platform headers are sent and this option has no effect. + +When enabled, the generated client accepts an optional `app_info` keyword of the shape `{ name:, version:, comment: }`, where `name` is required. Its product token is appended to the `User-Agent` header, which lets an application built on the SDK identify itself to the API, following the [HTTP `User-Agent` grammar](https://www.rfc-editor.org/rfc/rfc9110#name-user-agent). + +```ruby +client = Acme::Client.new( + token: "...", + app_info: { name: "partner-app", version: "3.1.0", comment: "+https://partner.example" } +) +``` + +The token is formatted as `{name}/{version} ({comment})`, dropping `/{version}` and `({comment})` when blank, and is appended to whatever `User-Agent` the SDK would otherwise send, including the structured header from [`includePlatformHeaders`](#includePlatformHeaders): + +``` +User-Agent: my-sdk/0.0.1 (linux; x86_64) Ruby/3.2.0 partner-app/3.1.0 (+https://partner.example) +``` + +Caller-supplied values are sanitized before they reach the header. An explicit `User-Agent` header takes precedence, the header is unchanged when no `app_info` is passed, and [`omitFernHeaders`](#omitFernHeaders) suppresses it entirely. + + From 3c6ad8373d6bbe2c533f1d1baeaa9bfef9100822 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 5 Aug 2026 17:12:51 +0000 Subject: [PATCH 2/2] docs: lowercase anchor links for platform-header options Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- fern/products/sdks/generators/go/configuration.mdx | 4 ++-- fern/products/sdks/generators/java/configuration.mdx | 2 +- fern/products/sdks/generators/php/configuration.mdx | 4 ++-- fern/products/sdks/generators/ruby/configuration.mdx | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fern/products/sdks/generators/go/configuration.mdx b/fern/products/sdks/generators/go/configuration.mdx index d50d84fa4b..f2d148b232 100644 --- a/fern/products/sdks/generators/go/configuration.mdx +++ b/fern/products/sdks/generators/go/configuration.mdx @@ -68,13 +68,13 @@ client := acmeclient.NewClient( ) ``` -The token is formatted as `{name}/{version} ({comment})`, dropping `/{version}` and `({comment})` when blank, and is appended to whatever `User-Agent` the SDK would otherwise send, including the structured header from [`includePlatformHeaders`](#includePlatformHeaders): +The token is formatted as `{name}/{version} ({comment})`, dropping `/{version}` and `({comment})` when blank, and is appended to whatever `User-Agent` the SDK would otherwise send, including the structured header from [`includePlatformHeaders`](#includeplatformheaders): ``` User-Agent: my-sdk/0.0.1 (linux; x86_64) Go/1.22.0 partner-app/3.1.0 (+https://partner.example) ``` -Caller-supplied values are sanitized before they reach the header. An explicit `User-Agent` header takes precedence, the header is unchanged when no name is passed, and [`omitFernHeaders`](#omitFernHeaders) suppresses it entirely. +Caller-supplied values are sanitized before they reach the header. An explicit `User-Agent` header takes precedence, the header is unchanged when no name is passed, and [`omitFernHeaders`](#omitfernheaders) suppresses it entirely. diff --git a/fern/products/sdks/generators/java/configuration.mdx b/fern/products/sdks/generators/java/configuration.mdx index 3e746e1287..b2c0e32374 100644 --- a/fern/products/sdks/generators/java/configuration.mdx +++ b/fern/products/sdks/generators/java/configuration.mdx @@ -127,7 +127,7 @@ AcmeApiClient client = AcmeApiClient.builder() .build(); ``` -The token is formatted as `{name}/{version} ({comment})`, dropping `/{version}` and `({comment})` when blank, and is appended to whatever `User-Agent` the SDK would otherwise send, including the structured header from [`includePlatformHeaders`](#includePlatformHeaders) and the version resolved by [`runtime-version`](#runtime-version): +The token is formatted as `{name}/{version} ({comment})`, dropping `/{version}` and `({comment})` when blank, and is appended to whatever `User-Agent` the SDK would otherwise send, including the structured header from [`includePlatformHeaders`](#includeplatformheaders) and the version resolved by [`runtime-version`](#runtime-version): ``` User-Agent: com.fern.sdk/0.0.1 (linux; x86_64) Java/17.0.13 partner-app/3.1.0 (+https://partner.example) diff --git a/fern/products/sdks/generators/php/configuration.mdx b/fern/products/sdks/generators/php/configuration.mdx index 9369fb7c27..69acfbcad7 100644 --- a/fern/products/sdks/generators/php/configuration.mdx +++ b/fern/products/sdks/generators/php/configuration.mdx @@ -70,13 +70,13 @@ $client = new AcmeClient('...', [ ]); ``` -The token is formatted as `{name}/{version} ({comment})`, dropping `/{version}` and `({comment})` when blank, and is appended to whatever `User-Agent` the SDK would otherwise send, including the structured header from [`includePlatformHeaders`](#includePlatformHeaders): +The token is formatted as `{name}/{version} ({comment})`, dropping `/{version}` and `({comment})` when blank, and is appended to whatever `User-Agent` the SDK would otherwise send, including the structured header from [`includePlatformHeaders`](#includeplatformheaders): ``` User-Agent: my-sdk/0.0.1 (linux; x86_64) PHP/8.2.0 partner-app/3.1.0 (+https://partner.example) ``` -Caller-supplied values are sanitized before they reach the header. An explicit `User-Agent` header takes precedence, the header is unchanged when no `appInfo` is passed, and [`omitFernHeaders`](#omitFernHeaders) suppresses it entirely. +Caller-supplied values are sanitized before they reach the header. An explicit `User-Agent` header takes precedence, the header is unchanged when no `appInfo` is passed, and [`omitFernHeaders`](#omitfernheaders) suppresses it entirely. diff --git a/fern/products/sdks/generators/ruby/configuration.mdx b/fern/products/sdks/generators/ruby/configuration.mdx index cc7bbd6ae8..deaff5c4cf 100644 --- a/fern/products/sdks/generators/ruby/configuration.mdx +++ b/fern/products/sdks/generators/ruby/configuration.mdx @@ -114,13 +114,13 @@ client = Acme::Client.new( ) ``` -The token is formatted as `{name}/{version} ({comment})`, dropping `/{version}` and `({comment})` when blank, and is appended to whatever `User-Agent` the SDK would otherwise send, including the structured header from [`includePlatformHeaders`](#includePlatformHeaders): +The token is formatted as `{name}/{version} ({comment})`, dropping `/{version}` and `({comment})` when blank, and is appended to whatever `User-Agent` the SDK would otherwise send, including the structured header from [`includePlatformHeaders`](#includeplatformheaders): ``` User-Agent: my-sdk/0.0.1 (linux; x86_64) Ruby/3.2.0 partner-app/3.1.0 (+https://partner.example) ``` -Caller-supplied values are sanitized before they reach the header. An explicit `User-Agent` header takes precedence, the header is unchanged when no `app_info` is passed, and [`omitFernHeaders`](#omitFernHeaders) suppresses it entirely. +Caller-supplied values are sanitized before they reach the header. An explicit `User-Agent` header takes precedence, the header is unchanged when no `app_info` is passed, and [`omitFernHeaders`](#omitfernheaders) suppresses it entirely.