Use audiences to filter your API
Use x-fern-audiences
to filter to relevant methods, parameters and schemas
Audiences are a useful tool for segmenting your JSON-RPC API for different consumers. Common examples of audiences include public
and beta
.
Remember to filter your SDKs and Docs after specifying audiences. If no audiences are specified, nothing will be filtered.
SDKs
The following example configures the SDK to filter to the public
audience:
Docs
The following example configures the docs to filter to the public
audience:
Filter methods
Add x-fern-audiences
to methods to control which methods are included for specific audiences:
Filter method parameters
You can filter specific parameters within methods:
Filter schemas
Filter entire schemas to different audiences:
Filter schema properties
You can filter individual properties within schemas:
Filter error responses
Filter error information based on audience:
Server-level filtering
Apply audience filtering at the server level:
Conditional method availability
Use audiences to make methods available only in certain contexts:
This allows you to create different views of the same JSON-RPC API for different types of consumers, ensuring each audience only sees the methods and data relevant to their use case.