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/audiences.mdx
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,3 +20,12 @@ navigation:
20
20
</CodeBlocks>
21
21
22
22
Here's [an example from Schematic](https://github.com/SchematicHQ/schematic-fern-config/blob/e19f5ea69a343727ed018e79127bf4fd20ad0f7b/fern/docs.yml#L128-L129) in production.
23
+
24
+
## Instance audiences
25
+
26
+
API Reference audiences work alongside [instance audiences](/docs/configuration/products#add-instance-audiences), which control which products and versions appear in each documentation instance. You can use both features together:
27
+
28
+
- **API Reference audiences** - Control which endpoints and schemas appear within API References
29
+
- **Instance audiences** - Control which products and versions appear in each instance
30
+
31
+
For example, you might have a `public` API Reference that shows only public endpoints. To ensure this API Reference only appears on your public documentation site, tag the containing product or version with the `public` audience.
Copy file name to clipboardExpand all lines: fern/products/docs/pages/customization/what-is-docs-yml.mdx
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,6 +119,8 @@ An `instance` is the backend of a distinct docs website. Each instance is publis
119
119
instances:
120
120
- url: plantstore.docs.buildwithfern.com
121
121
custom-domain: docs.plantstore.com
122
+
audiences:
123
+
- public
122
124
```
123
125
124
126
<ParamField path="instances" type="list of objects" required={false} toc={true}>
@@ -137,6 +139,12 @@ instances:
137
139
If specified, adds an "Edit this page" link to the bottom of each page that links to the given public GitHub repository. Learn more about the [`edit-this-page` configuration](#github-configuration).
138
140
</ParamField>
139
141
142
+
<ParamField path="instances.audiences" type="list of strings" required={false} toc={true}>
143
+
Specify which audiences this instance serves (e.g., internal developers, beta testers, public customers).
144
+
145
+
You can use audiences to control which versions and products appear in each documentation instance, enabling you to create separate sites for different user groups. Content is included when its audience tag matches the instance audience. Content without an audience tag is included by default. Learn more about configuring instance audiences for [products and/or versions](/docs/configuration/products#add-instance-audiences).
Copy file name to clipboardExpand all lines: fern/products/docs/pages/navigation/products.mdx
+53-1Lines changed: 53 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,7 +119,7 @@ If your `docs.yml` file includes a `navigation` field or a `tabs` field, be sure
119
119
</Step>
120
120
</Steps>
121
121
122
-
### Add versioning to your products (optional)
122
+
### Add versioning to your products
123
123
124
124
You can optionally add versions to your products. Versioned and unversioned products can live next to each other in your site.
125
125
@@ -213,6 +213,58 @@ If your product-specific `.yml` files for **versioned products** includes a `nav
213
213
</Step>
214
214
</Steps>
215
215
216
+
### Add instance audiences
217
+
218
+
Control which versions and/or products appear in each [documentation instance](/docs/configuration/what-is-docs-yml#instances-configuration) by tagging them with audiences. This enables separate sites for different user groups (e.g., internal developers, beta testers, public customers).
219
+
220
+
Content is filtered based on audience tags:
221
+
222
+
- **Match**: Content with an audience matching the instance audience is included
223
+
- **No match**: Content with a non-matching audience is excluded
224
+
- **No audience**: Content without an audience tag is included by default
225
+
226
+
Define audiences for instances, products, and versions in `docs.yml`:
227
+
228
+
<CodeBlock title="docs.yml">
229
+
```yaml
230
+
instances:
231
+
- url: internal.docs.buildwithfern.com
232
+
audiences:
233
+
- internal # Only shows content tagged with 'internal'
234
+
- url: public.docs.buildwithfern.com
235
+
audiences:
236
+
- public # Only shows content tagged with 'public'
237
+
products:
238
+
- display-name: Platform API
239
+
path: ./products/platform-api.yml
240
+
audiences:
241
+
- public
242
+
- internal # This product appears on both instances
243
+
versions:
244
+
- display-name: v3
245
+
path: ./versions/v3.yml
246
+
audiences:
247
+
- public # This version only appears on the public instance
248
+
- display-name: v2 (Internal)
249
+
path: ./versions/v2.yml
250
+
audiences:
251
+
- internal # This version only appears on the internal instance
252
+
- display-name: Admin Tools
253
+
path: ./products/admin-tools.yml
254
+
audiences:
255
+
- internal # This product only appears on the internal instance
256
+
```
257
+
</CodeBlock>
258
+
259
+
<Accordion title="Combining with API Reference audiences">
260
+
261
+
Instance audiences work alongside [API Reference audiences](/docs/api-references/audiences), which filter endpoints and schemas within your API documentation. You can use both features together:
262
+
263
+
- **Instance audiences** - Control which products and versions appear in each instance
264
+
- **API Reference audiences** - Control which endpoints and schemas appear within API References
265
+
266
+
For example, you might have a `public` instance that includes only public products. Within those products, the API Reference should be marked as `public` so it is filtered to show only `public` endpoints.
<Note>You can also have multiple products, some versioned and some unversioned. For more information on setting up multiple products, follow our [product switching docs](/docs/configuration/products).</Note>
43
+
<Note>You can also have [multiple products, some versioned and some unversioned](/docs/configuration/products).</Note>
44
44
</Step>
45
45
<Steptitle="Add your version configuration">
46
46
@@ -79,6 +79,41 @@ versions:
79
79
<Step title="Remove extra navigation from docs.yml">
80
80
81
81
If your `docs.yml` file includes a `navigation` field or a `tabs` field, be sure to remove. Those fields should now belong in the version-specific `.yml` files.
82
+
</Step>
83
+
<Step title="Add instance audiences">
84
+
85
+
Control which versions appear in each [documentation instance](/docs/configuration/what-is-docs-yml#instances-configuration) by tagging them with audiences. This enables separate sites for different user groups (e.g., internal developers, beta testers, public customers).
86
+
87
+
Content is filtered based on audience tags:
88
+
89
+
- **Match**: Content with an audience matching the instance audience is included
90
+
- **No match**: Content with a non-matching audience is excluded
91
+
- **No audience**: Content without an audience tag is included by default
92
+
93
+
Define audiences for instances and versions in `docs.yml`:
94
+
95
+
<CodeBlock title="docs.yml">
96
+
97
+
```yaml maxLines=10
98
+
instances:
99
+
- url: internal.docs.buildwithfern.com
100
+
audiences:
101
+
- internal # Only shows content tagged with 'internal'
102
+
- url: public.docs.buildwithfern.com
103
+
audiences:
104
+
- public # Only shows content tagged with 'public'
105
+
versions:
106
+
- display-name: v3
107
+
path: ./versions/v3.yml
108
+
audiences:
109
+
- public # This version only appears on the public instance
110
+
- display-name: v2 (Internal)
111
+
path: ./versions/v2.yml
112
+
audiences:
113
+
- internal # This version only appears on the internal instance
0 commit comments