salesforceCometdReceiver("https://example.my.salesforce.com", "/event/Order_Ready__e", auth, data).
Bind it to streams_salesforce. The receiver uses Salesforce API
64.0. Install a sealed bearer or OAuth2 credential with permission to
subscribe to the selected channel. Use matching
labels and call
streams.salesforce.initialize({ channel: "/event/Order_Ready__e" })
with the same full channel name. Create a fresh mount when the org or
channel changes.
For CDC, enable the entities in Salesforce and select a channel such as
/data/ChangeEvents, /data/AccountChangeEvent,
/data/Employee__ChangeEvent or /data/SalesEvents__chn.
Bind data above public. Review the org-wide read grants required by
Salesforce for the chosen channel before sealing the credential.
Salesforce CDC channel permissions
The app handshakes, subscribes with the Replay extension, and long-polls
the selected channel. Each successful connection response accepts up to 32
events and 36 KiB of wire JSON. The app retains each normalized JSON
payload as a File of at most 16 KiB. Platform events use EventUuid as
their event key. CDC keys are derived from the channel, entity,
transaction key and sequence number. A CDC event can name several
record IDs and its operation can be create, update, delete or undelete.
Read ChangeEventHeader for the operation and IDs. These Files record
change evidence, and the stream leaves materialized CRM records to the
consumer.
The last ReplayId moves in the same commit as the page. Replay IDs must
fit in the exact JavaScript integer range. A failed or interrupted session
restarts from the last committed ID. A provider refusal of that ID, a
CDC gap or overflow notification, or a CDC record-ID wildcard stops
progress for operator review. Use reset with the displayed revision
and gap instant to accept a baseline of the earliest retained events.
Reset and idle polls keep published events. Bayeux advances by
replay position and has no explicit per-event acknowledgement.
Salesforce CDC delivery
For a platform event channel, grant create permission on the event to
enable enqueue. Call publish({ command, message }) with a UTF-8 JSON
object up to 16 KiB. The host sends each task at most once.
publishStatus({ command }) reports the enqueue result. Salesforce
publishes asynchronously, so subscriber delivery has its own result.
An ambiguous send stays unknown.
Salesforce platform event publishing