Generate WebSocket Reference

View as Markdown
Pro and Enterprise feature

This feature is available only for the Pro and Enterprise plans. To get started, reach out to support@buildwithfern.com.

Fern generates WebSocket API Reference documentation from an AsyncAPI specification or Fern Definition.

WebSocket API Reference Example
Example of how a WebSocket API Reference renders in Fern

Configuration

  1. For both Fern Definition and AsyncAPI, add your WebSocket specification file to your /fern directory.

  2. For AsyncAPI only, reference the file in generators.yml:

    generators.yml
    1api:
    2 path: asyncapi.yml # Location of spec (required)
    3 origin: https://github.com/your-org/your-repo/blob/main/asyncapi.yml # Fetch from remote URL (optional)

    Fern Definition WebSocket files are auto-discovered (no additional configuration required).

Customize layout

You can customize the WebSocket endpoint display with title and slug properties, similar to REST endpoints. For more details, see Customize API Reference layout.

docs.yml
1navigation:
2 - api: API Reference
3 layout:
4 - user:
5 - endpoint: user.create
6 title: Create a User
7 slug: user-creation
8 - user.delete
9 - endpoint: WSS /v1/realtime
10 title: Realtime