Skip to content

docs(journeys): document data injection block IDs as recommended (legacy forms deprecated)#132

Merged
DeolaJ merged 5 commits into
mainfrom
aa/data-injection-block-ids-docs
Jun 17, 2026
Merged

docs(journeys): document data injection block IDs as recommended (legacy forms deprecated)#132
DeolaJ merged 5 commits into
mainfrom
aa/data-injection-block-ids-docs

Conversation

@DeolaJ

@DeolaJ DeolaJ commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

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, initialState keyed by block ID, and blocksDisplaySettings targeting by blockId), 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 :::note as 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 flat static/img convention) 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.
  • BlockDisplaySetting targets a block by blockId? (recommended) or the legacy blockName? + stepIndex? pair (deprecated).
  • initialStepId? (recommended, stable) and initialStepIndex? (deprecated, 0-based) are both documented.

Files updated

  • docs/journeys/embedding.md (legacy __epilot iframe 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 complete data-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 ## Changelog entry dated 2026-06-11: data injection documents block IDs as the recommended form (initialState keyed by block ID, initialStepId, and blocksDisplaySettings targeting by blockId), resilient to block renames and step reordering; the legacy step-index + block-name forms remain supported but are deprecated.

Test plan

  • Docs build / preview renders the three updated pages
  • Code fences and the inline data-injection-options JSON in web-components.md are valid (verified to parse)
  • Replace the journey-data-injection-builder.gif placeholder with the recorded GIF

Part of PROD-1469.

@DeolaJ DeolaJ changed the title docs(journeys): stable block IDs in journey data injection docs(journeys): document data injection block IDs as recommended (legacy forms deprecated) Jun 17, 2026
DeolaJ and others added 5 commits June 17, 2026 13:49
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.
Signed-off-by: Adeola Adeyemo <adeola.adeyemo@epilot.cloud>
@DeolaJ DeolaJ force-pushed the aa/data-injection-block-ids-docs branch from 89affdd to 9bd7014 Compare June 17, 2026 12:51
@DeolaJ DeolaJ merged commit b0d70f7 into main Jun 17, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant