diff --git a/fern/products/sdks/overview/typescript/configuration.mdx b/fern/products/sdks/overview/typescript/configuration.mdx index 0b9389de8..8cc4adf68 100644 --- a/fern/products/sdks/overview/typescript/configuration.mdx +++ b/fern/products/sdks/overview/typescript/configuration.mdx @@ -18,28 +18,28 @@ groups: ## SDK configuration options - + When enabled, the generator outputs raw TypeScript files. When disabled (the default), outputs `.js` and `d.ts` files. This only applies when dumping code locally. This configuration is ignored when publishing to Github or npm. - + When enabled, [`withCredentials`](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials) is set to `true` when making network requests. - + - + Generate WebSocket clients from your AsyncAPI specs. - + The default timeout for network requests. In the generated client, this can be overridden at the request level. - + By default, the client will throw an error if the response from the server doesn't match the expected type (based on how the response is modeled in the Fern Definition). @@ -50,7 +50,7 @@ If `skipResponseValidation` is set to `true`, the client will never throw if the - + Specify extra dependencies in the generated `package.json`. This is useful when you utilize [`.fernignore`](https://buildwithfern.com/learn/sdks/capabilities/custom-code) to supplement the generated client with custom code. @@ -64,7 +64,7 @@ config: - + Specify extra dev dependencies in the generated `package.json`. ```yaml @@ -77,7 +77,7 @@ config: Only applies when publishing to Github. - + Specify extra peer dependencies in the generated `package.json`: ```yaml @@ -89,7 +89,7 @@ config: ``` - + Specify extra peer dependencies meta fields in the generated `package.json`: ```yaml @@ -101,11 +101,11 @@ config: ``` - + When `treatUnknownAsAny` is enabled, [unknown types from Fern are generated into TypeScript using `any` instead of the `unknown` type](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-0.html#new-unknown-top-type). - + By default, Fern's `optional<>` properties will translate to optional TypeScript properties: ```yaml {4} @@ -132,7 +132,7 @@ config: ``` - + When you specify an object in `packageJson`, it will be merged into the `package.json` file. ```yaml @@ -150,12 +150,12 @@ config: ``` - + Publish your SDK to [JSR](https://jsr.io/). When enabled, the generator will generate a `jsr.json` as well as a GitHub workflow to publish to JSR. - + Change the type of stream that is used in the generated SDK. * `wrapper`: The streams use a wrapper with multiple underlying implementations to support versions of Node.js before Node.js 18. @@ -164,7 +164,7 @@ Change the type of stream that is used in the generated SDK. The default is `web`. - + Change the type of response returned to the user for a binary HTTP response: * `stream`: Returns a stream. See `streamType`, which controls the type of stream returned. @@ -181,25 +181,25 @@ const bodyUsed = response.bodyUsed; ``` - + Choose whether you want to support Node.js 16 and above (`Node16`), or Node.js 18 and above (`Node18`). * `Node16` uses multiple dependencies to support multipart forms, including `form-data`, `formdata-node`, and `form-data-encoder`. * `Node18` uses the native FormData API, and accepts a wider range of types for file uploads, such as `Buffer`, `File`, `Blob`, `Readable`, `ReadableStream`, `ArrayBuffer`, and `Uint8Array` - + Choose whether you want to include `node-fetch` to support Node.js versions before Node.js 18, or choose `native` to use the native `fetch` API available in Node.js 18 and later. - + Specify the path where the source files for the generated SDK should be placed. - + Allow fields that are not defined in object schemas. This only applies to serde. - + When enabled, the inline schemas will be generated as nested types in TypeScript. This results in cleaner type names and a more intuitive developer experience. @@ -255,7 +255,7 @@ const bar: MyRootType.Foo.Bar = {}; ``` - + Generate file upload properties as inline request properties (instead of positional parameters). `inlineFileProperties: false`: @@ -307,7 +307,7 @@ public async post( - + Inline path parameters into request types. `inlinePathParameters: false`: @@ -323,7 +323,7 @@ await service.getFoo({ pathParamName: "pathParamValue", id: "SOME_ID" }); - + By default, names are based on the organization and API names in the Fern Definition: ```typescript @@ -344,7 +344,7 @@ By default, names are based on the organization and API names in the Fern Defini - + No serialization/deserialization code is generated by default. The client uses `JSON.parse()` and `JSON.stringify()` instead of the default Serde layer. @@ -359,7 +359,7 @@ No serialization/deserialization code is generated by default. The client uses ` - + When enabled, property names in the generated code retain their original casing from the API definition instead of being converted to camelCase. ```yaml @@ -400,7 +400,7 @@ No serialization/deserialization code is generated by default. The client uses ` - + When `useBigInt` is set to `true`, a customized JSON serializer & deserializer is used that will preserve the precision of `bigint`'s, as opposed to the native `JSON.stringify` and `JSON.parse` function which converts `bigint`'s to number's losing precision. When combining `useBigInt` with our serialization layer (`no-serde: false`), both the request and response properties that are marked as `long` and `bigint` in OpenAPI/Fern spec, will consistently be `bigint`'s. @@ -451,7 +451,7 @@ interface ObjectWithLongAndBigInt { ``` - + When `useBrandedStringAliases` is disabled (the default), string aliases are generated as normal TypeScript aliases: @@ -504,7 +504,7 @@ interface ObjectWithLongAndBigInt { - + When enabled, the client doesn't throw errors when a non-200 response is received from the server. Instead, the response is wrapped in an [`ApiResponse`](packages/core-utilities/fetcher/src/APIResponse.ts). ```typescript @@ -519,7 +519,7 @@ interface ObjectWithLongAndBigInt { ### Beta options - + Includes the content type and content length from binary responses. The user will receive an object of the following type: @@ -534,13 +534,13 @@ Includes the content type and content length from binary responses. The user wil `` is `core.BinaryResponse` or a stream, depending on `fileResponseType` setting. - + - + - + Prevent the generator from running any scripts such as `yarn format` or `yarn install`. If any of the scripts cause errors, toggling this option will allow you to receive the generated code.