Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions fern/products/sdks/generators/csharp/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</ParamField>

<ParamField path="allow-user-agent-app-info" type="boolean" default="false" required={false} toc={true}>
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.
</ParamField>

<ParamField path="package-id" type="string" required={false} toc={true}>
Sets the NuGet package identifier for the generated SDK. This is used when publishing the SDK to NuGet or other package repositories.
</ParamField>
Expand Down
19 changes: 19 additions & 0 deletions fern/products/sdks/generators/go/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</ParamField>

<ParamField path="allowUserAgentAppInfo" type="boolean" default="false" required={false} toc={true}>
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.
</ParamField>

<ParamField path="enableWireTests" type="boolean" default="true" required={false} toc={true}>
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.
</ParamField>
Expand Down
19 changes: 19 additions & 0 deletions fern/products/sdks/generators/java/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</ParamField>

<ParamField path="allowUserAgentAppInfo" type="boolean" default="false" required={false} toc={true}>
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.
</ParamField>

<ParamField path="package-layout" type="'nested' | 'flat'" default="nested" required={false} toc={true}>
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.
</ParamField>
Expand Down
18 changes: 18 additions & 0 deletions fern/products/sdks/generators/php/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</ParamField>

<ParamField path="allowUserAgentAppInfo" type="boolean" default="false" required={false} toc={true}>
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.
</ParamField>

<ParamField path="packageName" type="string" required={false} toc={true}>
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`).
</ParamField>
Expand Down
19 changes: 19 additions & 0 deletions fern/products/sdks/generators/ruby/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
</ParamField>

<ParamField path="allowUserAgentAppInfo" type="boolean" default="false" required={false} toc={true}>
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.
</ParamField>

<ParamField path="requirePaths" type="array of strings" required={false} toc={true}>
<Markdown src="/snippets/enterprise-plan.mdx"/>

Expand Down
Loading