Envelope
Envelope<
TPayload> =object
Defined in: packages/postal/src/envelope.ts:19
Standard message wrapper used internally and exposed to subscribers.
Envelopes are the unit of communication in postal. Subscribers receive the full envelope, and transports serialize/deserialize them when bridging across execution boundaries.
Type Parameters
Section titled “Type Parameters”TPayload
Section titled “TPayload”TPayload = unknown
Properties
Section titled “Properties”channel
Section titled “channel”channel:
string
Defined in: packages/postal/src/envelope.ts:25
The channel this message was published on
correlationId?
Section titled “correlationId?”
optionalcorrelationId:string
Defined in: packages/postal/src/envelope.ts:37
Present on ‘reply’ envelopes — correlates back to the original request
id:
string
Defined in: packages/postal/src/envelope.ts:21
Unique message identifier (UUID v4)
payload
Section titled “payload”payload:
TPayload
Defined in: packages/postal/src/envelope.ts:29
The message payload
replyTo?
Section titled “replyTo?”
optionalreplyTo:string
Defined in: packages/postal/src/envelope.ts:35
Present on ‘request’ envelopes — the topic to send the reply to
source?
Section titled “source?”
optionalsource:string
Defined in: packages/postal/src/envelope.ts:33
Originating context identifier, set by transports to track message origin
timestamp
Section titled “timestamp”timestamp:
number
Defined in: packages/postal/src/envelope.ts:31
When the envelope was created — Date.now() for serialization safety
topic:
string
Defined in: packages/postal/src/envelope.ts:27
The dot-delimited topic string
type:
EnvelopeType
Defined in: packages/postal/src/envelope.ts:23
The kind of message