Skip to content

docs: add WebSocket client generation documentation#6006

Merged
devalog merged 6 commits into
mainfrom
devin/1782510134-document-websocket-clients
Jun 27, 2026
Merged

docs: add WebSocket client generation documentation#6006
devalog merged 6 commits into
mainfrom
devin/1782510134-document-websocket-clients

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds WebSocket client generation documentation covering all 5 supported languages (TypeScript, Python, Java, C#, Rust).

AsyncAPI spec example: uses components/messages with explicit messages refs on operations (required for correct send/receive association in AsyncAPI 3.0.0), consistent with existing AsyncAPI docs pages.

SDK examples per language, each verified against actual seed-generated code:

  • TypeScript: socket.on(event, handler) + socket.sendSendReading(...) + socket.close()
  • Python: sync/async context managers, ws.recv(), iteration, event-based ws.on(EventType.MESSAGE, ...) + ws.start_listening()
  • Java: PlantUpdatesWebSocketClient via client.plantUpdates().plantUpdatesWebSocket(id), CompletableFuture-based connect/send, Consumer<T> handlers (onPlantStatus, onConnected, onError)
  • C#: PlantUpdatesApi via client.CreatePlantUpdatesApi(Options), Event<T>.Subscribe(...), overloaded Send() methods (not per-message named)
  • Rust: client.plant_updates.create_plant_updates_connection(...), typed send_send_reading/recv/close

Send method naming: documents the send + operation name convention (e.g. sendReading operation → sendSendReading method).

Auth section: TS/Python/Java/Rust auto-forward auth headers; C# requires manual configuration via Options.

AsyncAPI overview: added Rust to supported languages list.

Link to Devin session: https://app.devin.ai/sessions/fb81f997fb784d9f8b030efd69e50801

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration devin-ai-integration Bot requested a review from devalog as a code owner June 26, 2026 21:42
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

rishabh-fern and others added 5 commits June 26, 2026 23:34
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…nguage examples, and auth section

- Fix AsyncAPI spec example to use components/messages with explicit message refs on operations
- Fix Python event-based example to use EventType enum instead of raw string
- Add Java, C#, and Rust SDK usage examples
- Add authentication section explaining header forwarding
- Update AsyncAPI overview to include Rust in supported languages

Co-Authored-By: Devin Logan <devinannlogan@gmail.com>
- Fix Java/C# class names to match plantUpdates channel (was stale Realtime naming)
- Fix C# example to use root client factory method (CreatePlantUpdatesApi)
- Fix auth section to distinguish C# pattern from TS/Python/Java/Rust
- Add one-liner explaining send method naming convention (send + operation name)
- Remove unused EventType import from Python sync snippet

Co-Authored-By: Devin Logan <devinannlogan@gmail.com>
…uirement

Co-Authored-By: Devin Logan <devinannlogan@gmail.com>

Fern generates typed WebSocket clients from your [AsyncAPI channel definitions](/learn/api-definitions/asyncapi/channels/pubsub). The generated clients handle connection management, typed send/receive messages, and automatic reconnection.

Fern generates WebSocket clients for TypeScript, Python, Java, C#, and Rust. Go generates types only, and Ruby is not yet supported.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Microsoft.Contractions] Use 'isn't' instead of 'is not'.

@devalog devalog merged commit 4e79ebd into main Jun 27, 2026
4 checks passed
@devalog devalog deleted the devin/1782510134-document-websocket-clients branch June 27, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants