docs(journeys): document data injection block IDs as recommended (legacy forms deprecated)#132
Merged
Merged
Conversation
Update the journey embedding docs (iframe embed, web component, SDK) so that data injection examples use stable, journey-wide block IDs: - initialState keyed by block ID instead of a step-index array of block names - initialStepId to start the journey at a step by its stable id - blocksDisplaySettings targeting blocks by blockId The legacy step-index + block-name forms remain documented as still supported. Each file also gets a dated changelog entry.
…ions initialState is a backward-compatible union of the recommended block-ID-keyed object and the deprecated step-index/block-name array; BlockDisplaySetting targets a block by blockId (recommended) or the deprecated blockName + stepIndex pair; initialStepId (recommended) and initialStepIndex (deprecated) are both documented. Legacy forms are kept and marked deprecated, not removed.
…review builder (web component + SDK)
Signed-off-by: Adeola Adeyemo <adeola.adeyemo@epilot.cloud>
89affdd to
9bd7014
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates the three public journey embedding docs so that data injection is documented around stable, journey-wide block IDs as the recommended way to prefill and target journey blocks, while keeping the legacy step-index + block-name forms documented as deprecated but still supported (backward-compatible). Block IDs are unique across the whole journey and unaffected by block renames or step reordering, so embeds keyed by block ID keep working when a journey is restructured.
Each Data Injection section now leads with a complete, recommended block-ID example (covering
initialStepId,initialStatekeyed by block ID, andblocksDisplaySettingstargeting byblockId), using consistent example values across all three transports so they line up:initialStepId: 'f0e1d2c3-b4a5-6789-0abc-def012345678'initialState: { 'b1f2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d': { city: 'Berlin' } }blocksDisplaySettings: [{ type: 'DISABLED', blockId: 'b1f2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d', blockFields: ['city'] }]The deprecated step-index + block-name array form now appears only inside each file's existing deprecated
:::noteas a secondary example.Each page also gains a short Data Injection (preview) builder subsection: the new Journey Builder tool lets authors visually pick blocks/fields, set pre-fill values and read-only blocks, choose the starting step, and copy the generated snippet — no hand-writing of block IDs. A GIF placeholder (
../../static/img/journey-data-injection-builder.gif, following the repo's flatstatic/imgconvention) plus a<!-- TODO: replace with recording -->marker are included on all three pages for a recording to be dropped in later.The option types remain backward-compatible unions from the previous commit — earlier forms were not removed:
initialState?: Record<string, Record<string, unknown>> | Record<string, unknown>[]— recommended: an object keyed by block ID → block value; deprecated (legacy): an array indexed by step position, each entry keyed by block name.BlockDisplaySettingtargets a block byblockId?(recommended) or the legacyblockName?+stepIndex?pair (deprecated).initialStepId?(recommended, stable) andinitialStepIndex?(deprecated, 0-based) are both documented.Files updated
docs/journeys/embedding.md(legacy__epilotiframe embed) — data-injection section leads with a complete__epilot.init([{ ..., dataInjectionOptions: { ... } }])block-ID example.docs/journeys/web-components.md(<epilot-journey>web component) — leads with a completedata-injection-options='{...}'JSON-attribute block-ID example (valid JSON).docs/journeys/sdk.md(@epilot/journey-embed-sdk) — leads with a complete$epilot.embed('123').asIframe().mode('full-screen').dataInjectionOptions({ ... }).append('#target')block-ID example.Changelog
Each file keeps its
## Changelogentry dated 2026-06-11: data injection documents block IDs as the recommended form (initialStatekeyed by block ID,initialStepId, andblocksDisplaySettingstargeting byblockId), resilient to block renames and step reordering; the legacy step-index + block-name forms remain supported but are deprecated.Test plan
data-injection-optionsJSON inweb-components.mdare valid (verified to parse)journey-data-injection-builder.gifplaceholder with the recorded GIFPart of PROD-1469.