LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
  • Ui
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Utils
  • Server
  • Stream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
  • Store
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
WebChannelsPregelPrebuiltRemote
React SDK
Vue SDK
Svelte SDK
Angular SDK
LangGraph SDK
UiClientAuthReactLoggingReact UiUtilsServerStream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
Store
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/angularinjectMessageMetadata
Function●Since v1.0

injectMessageMetadata

Copy
injectMessageMetadata(
  stream: AnyStream,
  messageId: string | Signal<string | undefined> | () => 
View source on GitHub
string
|
undefined
|
undefined
)
:
Signal
<
MessageMetadata
|
undefined
>

Parameters

NameTypeDescription
stream*AnyStream
messageId*string | Signal<string | undefined> | () => string | undefined | undefined

Read metadata recorded for a specific message id — today exposes parentCheckpointId, the checkpoint the message was first seen on. Designed for fork / edit flows:

readonly meta = injectMessageMetadata(this.stream, () => this.msg().id);
// meta()?.parentCheckpointId

messageId accepts a raw string, a Signal<string | undefined>, or a plain getter — the binding re-evaluates whenever the id changes.

Returns undefined when the id isn't known yet (e.g. the server hasn't emitted parent_checkpoint for that message, or the message arrived via messages-channel deltas only and no values snapshot has landed for it yet).