Skip to main content

React Native Journey Service

Functions

syncJourneys

syncJourneys(): Promise<boolean>

Synchronizes journey list with the Orchestrator.

Parameters:

  • None

getJourneys

getJourneys(
tags?: string[],
statuses?: string[],
onlyInAudience?: boolean
): Promise<Journey[]>

Fetches journeys from local storage with optional filters.

Parameters:

  • tags?: string[] — Optional journey tags.
  • statuses?: string[] — Optional journey statuses, see JourneyStatus.
  • onlyInAudience?: boolean — When true, returns only journeys whose audience includes this device. Defaults to false.

getJourney

getJourney(name: string): Promise<Journey | null>

Returns a journey by name.

Parameters:

  • name: string — Journey name.

runJourney

runJourney(name: string, data: Object): Promise<any>

Executes journey UI and returns the output JSON.

Parameters:

  • name: string — Journey name.
  • data: Object — Input payload.

getJourneyExecutionRecords

getJourneyExecutionRecords(name: string): Promise<JourneyExecutionRecord[]>

Returns all execution records for a journey.

Parameters:

  • name: string — Journey name.

getLastJourneyExecutionRecord

getLastJourneyExecutionRecord(name: string): Promise<JourneyExecutionRecord | null>

Returns the latest execution record for a journey.

Parameters:

  • name: string — Journey name.

getJourneyStatus

getJourneyStatus(name: string): Promise<JourneyStatus>

Returns the current journey status.

Parameters:

  • name: string — Journey name.

Classes

Journey

{
id: string;
name: string;
flow: JourneyFlow;
metadata: JourneyMetadata;
tags?: string[] | null;
zpdRequest?: JourneyZPDRequest | null;
createdAt: number;
updatedAt?: number | null;
publishedAt?: number | null;
}

JourneyMetadata

{
title: string;
description?: string | null;
imageUrl?: string | null;
}

JourneyFlow

{
xml: string;
data?: JourneyFlowData[] | null;
}

JourneyFlowData

{
type: string;
name: string;
source: string;
origin?: string | null;
}

JourneyZPDRequest

{
requested?: JourneyFlowData[] | null;
}

JourneyFlowDataType

"MEDATA" | "INPUT" | "CALCULATED" | "ANSWER"

JourneyStatus

"NOT_STARTED" | "COMPLETED" | "SENT"

JourneyStatusFilter

JourneyStatus[]

JourneyContext

{
values: { [key: string]: any };
}

JourneyExecutionRecord

{
id: string;
status: string;
journeyContext?: JourneyContext | null;
date: number;
}

JourneyZPD

{
data: SharedData[];
}

SharedData

{
type: string;
name: string;
source: string;
origin?: string | null;
value: string;
}