diff --git a/fern/products/sdks/generators/csharp/configuration.mdx b/fern/products/sdks/generators/csharp/configuration.mdx index b440858a6..45bb96bdb 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 e480de85f..f2d148b23 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 1e8cb8e54..b2c0e3237 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 b330555d0..69acfbcad 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 5367712ed..deaff5c4c 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. + +