Skip to content

docs: document AbortSignal for real-time connect()#508

Open
Hadi-Almusawi wants to merge 1 commit into
deepgram:mainfrom
Hadi-Almusawi:ha/abortsignal-docs
Open

docs: document AbortSignal for real-time connect()#508
Hadi-Almusawi wants to merge 1 commit into
deepgram:mainfrom
Hadi-Almusawi:ha/abortsignal-docs

Conversation

@Hadi-Almusawi

@Hadi-Almusawi Hadi-Almusawi commented Jun 11, 2026

Copy link
Copy Markdown

Proposed changes

Documents the abortSignal option on listen.v1.connect() (and agent.v1 / speak.v1). It's the supported way to cancel a connection and close it cleanly, even one that's still opening. The option already works, it just wasn't documented.

  • README: Quick Start pointer + new section "Canceling a WebSocket Connection (AbortSignal)".
  • New example 37-abortsignal-cancellation.ts: connect with AbortSignal → stream audio → call abort() to close the connection. Wired into the Makefile and make examples.
Example output (make example-37)
Connection opened
Transcript: yeah as as much as it's worth
Stopping session, aborting connection...
Connection closed
Connection aborted; no reconnect will occur.

Note on scope

Covers the AbortSignal documentation portion of #507. Exposing removeAllListeners() on the Fern-generated socket classes is intentionally out of scope, as those classes are generated from the API spec.

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.

1 participant