Configuration Model

Customize Trip Element for your needs

Configure Trip Element

The Trip Element can be customized through a configuration object that is included at the time of element creation.

const elementConfig = {
  ...
}

$sherpa.V2.createElement('trip', elementConfig).mount('#sherpa-widget')

Configuration Model

AttributeRequiredTypeDescriptionExample
languageOptionalStringdefault: en-US
View supported languages
Localize the Trip Element
placementRequiredStringName of booking stage or page the element is embedded on. Used for measuring engagement in analytics reports.
Supported values:

homePage - Home Page
discovery - Generic pre-booking marketing page
mmb - Manage My Booking
search - Search
bookingConfirmation - Booking Confirmation
destinationPage - dedicated marketing page for a destination
covidPage - dedicated page for COVID-19 resources
Basic Discovery Placement
segmentsOptionalArray of ObjectsView Segment ModelReturn Trip
travellersOptionalArray of ObjectsView Traveller ModelDefining a Traveller
featuresOptionalObjectView Features Model
cookieConsentPreferencesOptionalArray of StringsAn optional list of cookie consent type names that constitute a cookie policy that should apply to this Element (and to all other existing or future Embedded Elements or Application Widgets). See Setting a Cookie Policy for a list of valid cookie consent type names. If no cookie consent preference is specified, the new Element will use the most recently specified cookie policy (set either when creating a previous Embedded Element or Application Widget or by using the setCookiePreferences() method on the SDK). If there is no previously specified cookie policy, a minimal cookie policy will be employed that allows only those cookies that are needed for the Element to function.Setting a Cookie Policy

Segment Model

Describe the trip using a set of Segments.

An example of the segment model using the all of the attributes in the table below can be found here.

AttributeRequiredTypeDescription
segmentTypeRequiredString
OUTBOUND, RETURN
Direction of the flight.
segmentSubTypeRequired for connecting flight.String
TRANSIT
Is this a connecting flight.
originOptional if features.showResults is false;
Required otherwise
ObjectView Location Model
destinationOptional if features.showResults is false;
Required otherwise
ObjectView Location Model
travelModeOptionalString
AIR
Default: AIR
flightIATACarrierCodeRequired for specific declarations.StringIATA Code of the carrier
flightNumberRequired for specific declarations.StringFlight number
departureDateOptional. If omitted, this date will default to the current day for OUTBOUND segmentTypes and to one week from the current day for RETURN segmentTypes.String
YYYY-MM-DD
Date of departure
departureTimeOptionalString
HH:MM:SS
Time of departure
arrivalDateOptional. If omitted, this date will default to the current day for OUTBOUND segmentTypes and to one week from the current day for RETURN segmentTypes.String
YYYY-MM-DD
Date of arrival
arrivalTimeOptionalString
HH:MM:SS
Time of arrival

Location Model

One of the following attributes is required.

AttributeRequiredTypeDescriptionExamples
countryCodeOptional, if one other is specifiedStringISO3 Country Code, e.g. CAN for CanadaeVisa Trip Element Pre-Configuration
airportCodeOptional, if one other is specifiedStringIATA Airport Code e.g. YYZ for Pearson International Airport, Toronto, CanadaUsing Airport and Region Code
regionCodeOptional, if one other is specifiedStringalpha3 Region Code e.g. US-TX for Texas, USAUsing Airport and Region Code

Traveller Model

AttributeRequiredTypeDescriptionExample
nationalityOptionalStringISO3 Country Code, e.g. CAN for CanadaDefining a Traveller
passportOptionalObjectPassport details of the travel
vaccinationsOptionalArray of ObjectsView Vaccination ModelDefining a Traveller

Passport Model

AttributeRequiredTypeDescriptionExample
numberOptionalStringPassport numberNN234567
nationalityOptionalStringPassport nationalityCAN
givenNamesOptionalStringGiven names as stated on passportJohn Richard
surnameOptionalStringSurname as stated on passportSmith
issueDateOptionalStringIssue date as stated on passport2020-01-30
expiryDateOptionalStringExpiry date as stated on passport2030-01-29
issuingCountryOptionalStringIssuing country as stated on passportCAN
issuingAuthorityOptionalStringIssuing authority as stated on passportGatineau
dateOfBirthOptionalStringDate of birth as stated on passport1990-12-30
genderOptionalStringGender as stated on passportFemale

Vaccination Model

AttributeRequiredTypeDescription
typeOptionalStringCurrently only value 'COVID_19'
statusOptionalString
FULLY_VACCINATED, NOT_VACCINATED
Indication of being fully vaccinated or not

Features Model

Customize the appearance of the Trip Element by enabling & disabling feature flags.

AttributeRequiredTypeDescriptionExample
showSegmentsOptionalBooleanShow/hide navigation between segments
Default: true
Hide segments
showTitleOptionalBooleanShow/hide title
Default: true
Hide title
enableSegmentEditorOptionalBooleanShow/hide the UI to edit a trip, including "Edit my trip" button.Hide Segment Editor
showFilterPassportOptionalBooleanShow/hide Select Passport UIShow Filter Passport
showFilterVaccinatedOptionalBooleanShow/hide Vaccination Toggle UIShow Filter Vaccinated
showResultsOptionalBooleanShow/hide travel restrictions results on load
Default: true
Show Results

❗️

showResults Feature

showResults is true by default, if this is true origin and destination has to be specified. Set this to false to load the widget with no destination and origin specified.