You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fern/products/docs/pages/api-references/sdk-snippets.mdx
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,13 @@ title: Display SDK snippets
3
3
description: Enable SDK code examples in TypeScript, Python, Go, and more from the request and response examples documented in your API definition. Once enabled, Fern Docs will automatically populate the snippets within your API Reference.
4
4
---
5
5
6
-
When you use Fern's SDK Generator, you can automatically display SDK code snippets in your API Reference. These snippets appear in a language selector dropdown, with cURL as the default option.
6
+
When you use Fern's SDK Generator, you can automatically display SDK code snippets in your API Reference. These snippets are generated from your API definition examples and appear in a language selector dropdown, with cURL as the default option.
7
7
8
-
<Note> Fern supports SDK snippets for TypeScript, Python, Ruby, Go, and .NET/C#. </Note>
8
+
<Notetitle="Dynamic snippets">
9
+
By default, SDK snippets are static code examples. Alternatively, you can use dynamic SDK snippets that allow users to modify parameters and see code examples update in real time.
10
+
11
+
To use dynamic snippets, [enable them in your `docs.yml`](/docs/configuration/what-is-docs-yml#dynamic-snippets-configuration) and then complete the setup instructions on this page.
@@ -27,6 +31,8 @@ Configure package names in your `generators.yml` file:
27
31
* For **Python, TypeScript, Ruby, and .NET/C#**, add `package-name: your-package-name` to the `output` section.
28
32
* For **Go**, add `repository: your-organization/your-repository` to the `github` section.
29
33
34
+
<Note>Fern supports SDK snippets for TypeScript, Python, Ruby, Go, and .NET/C#. [Contact us](https://buildwithfern.com/contact) if you need support for more languages. </Note>
35
+
30
36
<CodeBlocktitle="generators.yml">
31
37
```yaml {9, 16, 22, 26}
32
38
groups:
@@ -71,6 +77,7 @@ groups:
71
77
</Callout>
72
78
73
79
### Add the package name to your docs configuration
80
+
74
81
Add the package name for the corresponding SDK to your `docs.yml` file:
75
82
***For Python, TypeScript, Ruby, and .NET/C#**, `your-package-name` must match the `your-package-name` that you configured in your `generators.yml` file.
76
83
***For Go**, use the exact URL where the SDK repository is located, including the `https://github.com/`.
@@ -110,7 +117,7 @@ navigation:
110
117
111
118
### Trigger generation
112
119
113
-
As the final step, trigger your docs generation by running `fern generate --docs` locally or in CI/CD (i.e., GitHub Actions). The SDK snippets will now appear via a drop-down!
120
+
As the final step, trigger your docs generation by running `fern generate --docs` locally or in CI/CD (i.e., GitHub Actions). The SDK snippets will now appear via a dropdown!
Your PostHog project API key. Defaults to the api-host of "https://us.i.posthog.com".
560
560
</ParamField>
561
+
562
+
## Dynamic snippets configuration
563
+
564
+
By default, SDK snippets are static code examples that are displayed in your API Reference. Alternatively, you can use dynamic SDK snippets that allow users to modify parameters and see code examples update in real time.
565
+
566
+
Enable dynamic snippets in `docs.yml`, then configure them by [following the SDK snippets setup instructions](/docs/api-references/sdk-snippets).
Copy file name to clipboardExpand all lines: fern/products/docs/pages/getting-started/preview-changes-locally.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ fern docs dev
37
37
A local preview of your documentation will be available at `http://localhost:3000`. The functionality is available offline if you have run local development mode online at least once.
38
38
39
39
<Note>
40
-
Some features (e.g. search) are disabled in the local development environment, including:
40
+
Some features are disabled in the local development environment, including:
0 commit comments