Experience Journey
The Experience Journey system provides a state machine for orchestrating complex consumer journeys through multiple stages of an experience. It handles routing, authentication requirements, sequence selection, and distribution participation.Overview
An “Experience” in Fanfare is a container that can include multiple sequences and distribution types (queues, draws, auctions, timed releases). TheExperienceJourney class manages the consumer’s progression through these stages.
Creating a Journey
createJourney with the same experience ID returns the existing journey instance.
Journey Stages
JourneyStage
High-level stages of the journey:| Stage | Description |
|---|---|
not_started | Journey has not begun |
entering | Entering the experience |
needs_auth | Authentication is required |
needs_access_code | Access code is required |
routing | Finding the appropriate sequence |
routed | Successfully routed to a sequence |
SequenceStage
Stages within a routed sequence:| Stage | Description |
|---|---|
none | No sequence stage (pre-routing) |
upcoming | Distribution is scheduled but not active |
waitlist_entered | Consumer is on the waitlist |
active_enterable | Active distribution, consumer can enter |
participating | Actively participating in distribution |
admitted | Admitted with valid token |
admission_expired | Admission token has expired |
ended | Distribution has ended |
State Snapshot
The journey state is accessible via thestate atom:
Subscribing to State Changes
Lifecycle Methods
start()
Begins the journey. Optionally accepts an access code.destroy()
Removes the journey and clears state.Requirement Handling
Requirements
The journey may require certain conditions to be met:authenticate()
Call after the consumer has authenticated:provideAccessCode()
Provide an access code:skipAccessCode()
Skip the access code requirement if optional:completeBotCheck()
Mark bot check as complete:Distribution Participation
refreshDistribution()
Refresh the current distribution context:startPolling() / stopPolling()
Poll for distribution updates:enterQueue()
Enter the active queue:enterDraw()
Enter the active draw:enterAuction()
Enter the active auction:enterTimedRelease()
Enter the active timed release:completeTimedRelease()
Complete a timed release (after successful purchase):enterWaitlist()
Join the waitlist for an upcoming distribution:leaveWaitlist()
Leave the waitlist:leaveParticipation()
Leave the current distribution:markAdmitted()
Mark the consumer as admitted with a token:Actions API
perform()
Execute any available action by name:Available Actions
Journey actions:start- Begin the journeyauthenticate- Mark authentication completeprovide_access_code- Provide an access codeskip_access_code- Skip optional access coderequest_reroute- Request re-routingretry- Retry current operationcomplete_bot_check- Mark bot check completerefresh_distribution- Refresh distribution data
enter_waitlist- Join waitlistleave_waitlist- Leave waitlistenter_queue- Enter queueenter_draw- Enter drawenter_auction- Enter auctionenter_timed_release- Enter timed releasecomplete_timed_release- Complete timed releaseleave_participation- Leave current distribution