Skip to content

Commit 1dcbb81

Browse files
author
Mohannad
committed
journey data injection docs
1 parent 1218117 commit 1dcbb81

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/journeys/embedding.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,26 @@ Depending on the embedding type, you can change additional settings.
2424

2525
![Embedding Configuration](../../static/img/journey-builder-embed.png)
2626

27+
## Journey Data Injection
28+
It is possible by using the Embed Script to modify the initial state of the journey. There are the following posibilities:
29+
1. Setting an intial data for the journey: doing this will prefill the blocks with data.
30+
2. Starting the journey from a specific step: doing this will start the journey from the specified step if it was combined with the initial data, one can achieve a case when a product is selection is done in an external website, injected into the journey, then the in journey selection step skipped.
31+
3. Set display options for the journey fields (for now disabling fields)
32+
33+
The following DataInjectionOptions type shows what is possible. However we ask devs to go to our [epilot Journey SDK](https://github.com/epilot-dev/epilot-journey-sdk) project which includes more documentation supported with examples.
34+
35+
**Type Definition**
36+
```typescript
37+
export type DataInjectionOptions = {
38+
/** the initial step index of the journey. aka, where to start the journey from */
39+
initialStepIndex?: number
40+
/** the initial state of the journey. aka, what data to prefill the journey with */
41+
initialState?: Record<string, unknown>[]
42+
/** the display options to be passed to the journey, for now it is used to disable some fields */
43+
blocksDisplaySettings?: BlockDisplaySetting[]
44+
}
45+
``````
46+
2747
## Configuration Possibilities
2848
For more advanced configuration options, you can modify the embed script yourself, as it adds an interface to your website to interact with the journey: `__epilot`
2949
Below we explain all possibile configuration options
@@ -65,6 +85,8 @@ type OptionsInit = {
6585
contextData?: Record<string, unknown>
6686
/** the language the journey should be initialised in */
6787
lang?: string
88+
/** the data injext options that will be passed to the journey */
89+
dataInjectionOptions?: DataInjectionOptions
6890
}
6991
```
7092

0 commit comments

Comments
 (0)