Skip to content

Commit 35c3dd0

Browse files
authored
Clarify Package Naming sections in SDK Snippets page (#73)
1 parent feb7858 commit 35c3dd0

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

fern/products/docs/pages/api-references/sdk-snippets.mdx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,20 @@ If you use Fern's SDK Generator, you can automatically show SDK code snippets in
1111

1212
## Configuring SDK Snippets
1313

14-
To configure SDK snippets, you'll need to name your SDKs in `generators.yml` and then reference that name in `docs.yml`. In the following example, We'll use `your-organization` as the package name because it is a common practice. For example, Stripe calls their npm package `stripe` and Twilio calls their PyPI package `twilio`.
14+
To configure SDK snippets, you'll need to name your SDKs in `generators.yml` and then reference that name in `docs.yml`. In the following example, we'll use `your-organization` as the package name because it is a common practice. For example, Stripe calls their npm package `stripe` and Twilio calls their PyPI package `twilio`.
1515

1616
### Add examples to your API definition
1717

1818
In order to generate code snippets, Fern needs to read request examples from your API definition. If you're using a Fern Definition, you can follow [these instructions](/learn/api-definition/fern/examples). If you're using an OpenAPI Specification, you can follow [these instructions](https://swagger.io/docs/specification/adding-examples/).
1919

2020
### Define a package name for your SDK(s)
2121

22+
Configure package names in your `generators.yml` file:
23+
* For **Python/TypeScript/Ruby**, add `package-name: your-package-name` to the `output` section.
24+
* For **Go**, add `repository: your-organization/your-repository` to the `github` section.
25+
2226
<CodeBlock title="generators.yml">
23-
```yaml
27+
```yaml {9, 16, 22, 26}
2428
groups:
2529
production:
2630
generators:
@@ -57,15 +61,18 @@ groups:
5761
</Callout>
5862

5963
### Add the package name to your docs configuration
60-
Add the package name for the corresponding SDK to your `docs.yml` file. For Go, use the exact URL where the SDK repository is located.
64+
Add the package name for the corresponding SDK to your `docs.yml` file:
65+
* **For Python, TypeScript, and Ruby**, `your-package-name` must match the `your-package-name` that you configured in your `generators.yml` file.
66+
* **For Go**, use the exact URL where the SDK repository is located, including the `https://github.com/`.
6167

6268
<CodeBlock title="docs.yml">
63-
```yaml
69+
```yaml {4-7}
6470
navigation:
6571
- api: API Reference
6672
snippets:
6773
python: your-package-name # <--- needs to match the naming in generators.yml
68-
typescript: your-package-name
74+
typescript: your-package-name # <--- needs to match the naming in generators.yml
75+
ruby: your-package-name # <--- needs to match the naming in generators.yml
6976
go: https://github.com/your-organization/your-repository # <--- needs the https://github.com/ prefix
7077
```
7178
</CodeBlock>

0 commit comments

Comments
 (0)