[PR #1675] [MERGED] feat(sdk): useStream with custom transport #1639

Closed
opened 2026-02-15 20:16:22 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langgraphjs/pull/1675
Author: @dqbd
Created: 9/18/2025
Status: Merged
Merged: 9/18/2025
Merged by: @dqbd

Base: mainHead: dqbd/use-stream-custom


📝 Commits (10+)

📊 Changes

6 files changed (+993 additions, -634 deletions)

View changed files

.changeset/heavy-wings-sing.md (+5 -0)
📝 libs/sdk/src/react/index.ts (+9 -1)
libs/sdk/src/react/stream.custom.tsx (+217 -0)
libs/sdk/src/react/stream.lgp.tsx (+652 -0)
📝 libs/sdk/src/react/stream.tsx (+54 -633)
📝 libs/sdk/src/react/types.tsx (+56 -0)

📄 Description

Trimmed version of useStream that does not imply usage with LangGraph API, rather just relying on streaming output of toLangGraphEventStream / toLangGraphEventStreamResponse

Usage:

const stream = useStream({
  transport: new FetchStreamTransport({ apiUrl: "/api/stream" })
})

Related PR: #1554


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langgraphjs/pull/1675 **Author:** [@dqbd](https://github.com/dqbd) **Created:** 9/18/2025 **Status:** ✅ Merged **Merged:** 9/18/2025 **Merged by:** [@dqbd](https://github.com/dqbd) **Base:** `main` ← **Head:** `dqbd/use-stream-custom` --- ### 📝 Commits (10+) - [`f221fbc`](https://github.com/langchain-ai/langgraphjs/commit/f221fbcc5e30c2a2892cefd74424e2bba3817aa3) feat(sdk): introduce useStreamCustom using barebones streaming protocol - [`046b63e`](https://github.com/langchain-ai/langgraphjs/commit/046b63e1d0b292799040583e3e1fd4e9b618ae5f) Handle optimistic values - [`84a55b4`](https://github.com/langchain-ai/langgraphjs/commit/84a55b459ca4f47714ef50e5062ff2dd2837b373) Merge two hooks into one - [`a8e4ffa`](https://github.com/langchain-ai/langgraphjs/commit/a8e4ffab8244e13657b0590714d1d87338cd4cf1) Add branching logic - [`ef4f5e5`](https://github.com/langchain-ai/langgraphjs/commit/ef4f5e5f05c4180d1ec203632a263a6fb1151b47) Fix lint - [`36c263e`](https://github.com/langchain-ai/langgraphjs/commit/36c263ecf1a5777af2b0f93d38c24636f877f7e5) Decouple transport - [`d813c74`](https://github.com/langchain-ai/langgraphjs/commit/d813c74ce1364338b8f4bdf7fa15fff82902a87e) Move to examples - [`058d998`](https://github.com/langchain-ai/langgraphjs/commit/058d998c1658ccd78d001a97956ed08418b8d90f) Rename to stream-transport-vite - [`e0eab08`](https://github.com/langchain-ai/langgraphjs/commit/e0eab08783e66acb48c0166b5cb4a0c3b7ef21d9) Use dep for tsx - [`1d2c476`](https://github.com/langchain-ai/langgraphjs/commit/1d2c4769ae44ffbe3f9062275d7e489898e00027) Remove unnecessary file ### 📊 Changes **6 files changed** (+993 additions, -634 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/heavy-wings-sing.md` (+5 -0) 📝 `libs/sdk/src/react/index.ts` (+9 -1) ➕ `libs/sdk/src/react/stream.custom.tsx` (+217 -0) ➕ `libs/sdk/src/react/stream.lgp.tsx` (+652 -0) 📝 `libs/sdk/src/react/stream.tsx` (+54 -633) 📝 `libs/sdk/src/react/types.tsx` (+56 -0) </details> ### 📄 Description Trimmed version of `useStream` that does not imply usage with LangGraph API, rather just relying on streaming output of `toLangGraphEventStream` / `toLangGraphEventStreamResponse` Usage: ```typescript const stream = useStream({ transport: new FetchStreamTransport({ apiUrl: "/api/stream" }) }) ``` Related PR: #1554 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 20:16:22 -05:00
yindo closed this issue 2026-02-15 20:16:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#1639