Skip to content

Commit 7c8e0f5

Browse files
committed
clarify namespaceExport option
1 parent bdd82a3 commit 7c8e0f5

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

fern/products/sdks/overview/typescript/configuration.mdx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ groups:
1313
- name: fernapi/fern-typescript-sdk
1414
version: <Markdown src="/snippets/version-number-ts.mdx"/>
1515
config:
16-
namespaceExport: Acme
16+
namespaceExport: AcmePayments
1717
```
1818
1919
## SDK configuration options
@@ -258,26 +258,28 @@ await service.getFoo({ pathParamName: "pathParamValue", id: "SOME_ID" });
258258
</ParamField>
259259

260260
<ParamField path="namespaceExport" type="string" toc={true}>
261-
By default, names are based on the organization and API names in the Fern Definition:
261+
Customizes the exported namespace and client class names in the generated SDK. Must be in PascalCase.
262+
263+
By default, names are derived from the organization and API names defined in your API definition:
262264

263-
```typescript
264-
import { AcmeApi, AcmeApiClient } from "@acme/node";
265-
```
265+
```typescript
266+
import { AcmeApi, AcmeApiClient } from "@acme/node";
267+
```
266268

267-
`namespaceExport` customizes the exported namespace and client names:
269+
Setting namespaceExport overrides these default names:
268270

269-
```yaml
270-
# generators.yml
271-
config:
272-
namespaceExport: Acme
273-
```
271+
```yaml title="generators.yml"
272+
config:
273+
namespaceExport: AcmePayments
274+
```
274275

275-
```typescript
276-
import { Acme, AcmeClient } from "@acme/node";
277-
```
276+
```typescript
277+
import { AcmePayments, AcmeClient } from "@acme/node";
278+
```
278279

279280
</ParamField>
280281

282+
281283
<ParamField path="neverThrowErrors" type="boolean" default="false" toc={true}>
282284
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`](https://github.com/fern-api/fern/blob/main/seed/ts-sdk/alias/src/core/fetcher/APIResponse.ts).
283285

0 commit comments

Comments
 (0)