LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
  • Stream
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
WebChannelsPregelPrebuiltRemoteStream
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 v1.4

ThreadsClient

Copy
class ThreadsClient

Bases

BaseClient

Constructors

Properties

Methods

View source on GitHub
constructor
constructor→ ThreadsClient<TStateType, TUpdateType>
property
apiUrl: string
property
asyncCaller: AsyncCaller
property
defaultHeaders: Record<string, HeaderValue>
property
onRequest: RequestHook
property
timeoutMs: number | undefined
method
copy→ Promise<Thread<TStateType, unknown>>
method
count→ Promise<number>
method
create→ Promise<Thread<TStateType, unknown>>
method
delete→ Promise<void>
method
fetch→ Promise<[T, Response]>
method
get→ Promise<Thread<ValuesType, unknown>>
method
getHistory→ Promise<ThreadState<ValuesType>[]>
method
getState→ Promise<ThreadState<ValuesType>>
method
joinStream→ AsyncGenerator<__type>
method
patchState→ Promise<void>
method
prepareFetchOptions→ [URL, RequestInit]
method
search→ Promise<Thread<ValuesType, unknown>[]>
method
streamWithRetry→ AsyncGenerator<T>
method
update→ Promise<Thread<DefaultValues, unknown>>
method
updateState→ Promise<Pick<Config, "configurable">>

Copy an existing thread

Count threads matching filters.

Create a new thread.

Delete a thread.

Get a thread by ID.

Get all past states for a thread.

Get state for a thread.

Patch the metadata of a thread.

List threads

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

Update a thread.

Add state to a thread.