LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph SDK
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Server
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangGraph SDK
ClientAuthReactLoggingReact UiServer
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
LangGraph Checkpoint Redis
ShallowStore
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
Cli
LangGraph API
LangGraph CLI
LangGraph CUA
Utils
LangGraph Supervisor
LangGraph Swarm
Language
Theme
JavaScript@langchain/langgraph-sdkclientThreadsClient
Class●Since v0.0

ThreadsClient

Copy
class ThreadsClient

Bases

BaseClient

Constructors

constructor
constructor→ ThreadsClient<TStateType, TUpdateType>

Properties

property
apiUrl: string
property
asyncCaller: AsyncCaller
property
defaultHeaders: Record<string, HeaderValue>
property
onRequest: RequestHook
property
timeoutMs: number | undefined

Methods

method
copy→ Promise<Thread<TStateType, unknown>>

Copy an existing thread

method
count→ Promise<number>

Count threads matching filters.

method
create→ Promise<Thread<TStateType, unknown>>

Create a new thread.

method
delete→ Promise<void>

Delete a thread.

method
fetch→ Promise<[T, Response]>
method
get→ Promise<Thread<ValuesType, unknown>>

Get a thread by ID.

method
getHistory→ Promise<ThreadState<ValuesType>[]>

Get all past states for a thread.

method
getState→ Promise<ThreadState<ValuesType>>

Get state for a thread.

method
joinStream→ AsyncGenerator<__type>
method
patchState→ Promise<void>

Patch the metadata of a thread.

method
prepareFetchOptions→ [URL, RequestInit]
method
search→ Promise<Thread<ValuesType, unknown>[]>

List threads

method
streamWithRetry→ AsyncGenerator<T>

Protected helper for streaming with automatic retry logic. Handles both initial requests and reconnections with SSE.

method
update→ Promise<Thread<DefaultValues, unknown>>

Update a thread.

method
updateState→ Promise<Pick<Config, "configurable">>

Add state to a thread.

View source on GitHub