Javascript SDK V1

Embed and configure widgets showing personalized entry requirements, international and domestic travel restrictions and eVisa and eHealth ancillary products on your website or platform.

❗️

Deprecated

The Javascript SDK V1 is being deprecated, please use the SDK V2. Check out our migration guide.

Overview

Embeddable elements inform your travellers of visa requirements and accept submissions through an optimized application process. Integration with your customer experience is as easy as following the two-step process below.

Preview our eVisa widget below, and contact us for a custom guide that will allow you to drop a pre-configured widget onto any page in your traveller experience.

  • Pre-filled applications - Secure handover of booking details so that travellers don't have to re-enter information.
  • Mobile optimized - Fully responsive for any size device.
  • Secure payments - PCI compliant & able to process transactions from all over the world
  • Style & Brand - We'll style everything using your brand & style guide for a unified experience.
  • Localization - Present entry requirements in Arabic, Danish, German, English, Spanish, Finnish, French, Icelandic, Italian, Dutch, Norwegian, Polish, Russian, Swedish and Simplified Chinese.

Widget Preview

Integration Step 1: Place the widget

The below script can be added to any HTML page, where the endUrl parameter is provided as part of your custom implementation guide.

<script src=”{endUrl}”></script>

<div id=”sherpa-widget”></div>
EnvironmentendUrl
SandboxProvided in custom integration guide
ProductionProvided in custom integration guide

2. Create the widget

Define the callback function:

function onSherpaEvent(event){
	console.log(event);
}

📘

Tip

“iframeStartLoading” event passes back the options through the attribute data which were used to initialize the widget. This is a good way to check against if the widget shows unexpected information.

Once the SDK is loaded, the following output will be shown:

{type: "sdkLoaded", data: null}
	a. data: null
	b. type: "sdkLoaded"

After the SDK loaded event, the following function can be used to create the widget on the page:

<<createWidget>>

The list of possible SDK events is available here:

event.typeDescription
sdkLoadedSDK javascript is loaded
iframeStartLoadingIntegration iframe started loading
iframeSuccessIframe loaded successfully
iframeFailureIframe loading issue
orderSuccessUser successfully placed an order
orderDeclineUser declined the order
modalCloseUser closed iframe

3. Pass Parameters

Passing parameters to the widget pre-populates the application, which makes it easier for travellers to complete and avoids asking them to re-enter information.

Note that the user will still be able to change the details where necessary. This means that we can guess values that aren’t necessarily known but will often be the same (e.g. nationality).

A list of parameters that can be passed to the widget is available here.

Check out the preview above in order to see how the parameters are passed to the widget. Note that this example doesn't include your custom styling

Testing Payment

Test a purchase using the below credit card details:

Card Number: 4242 4242 4242 4242
Expiration Date: any date in the future
CSV number: any random digits

Widget Options

You can also view the entire sheet with all widget options directly.

Localization

Pass the appropriate language code via language parameter.

LanguageCodeVisa InformationCOVID Travel Restrictions
EnglishenSupportedSupported
SpanishesSupportedSupported
GermandeSupported-
FrenchfrSupported-
ArabicarSupported-
DanishdkSupported-
FinnishfiSupported-
IcelandicisSupported-
DutchnlSupported-
NorwegiannoSupported-
PolishptSupported-
RussianruSupported-
SwedishswSupported-
Simplified ChinesezhSupported-

Features

Feature FlagDescriptionType
showDestinationSelectorShow/hide select destination UIboolean
showDepartureDateSelectorShow/hide select departure date UIboolean
showPassportSelectorShow/hide select passport UIboolean
showOriginSelectorShow/hide select origin UIboolean
showSubscribeShow subscribe to alerts buttonboolean
showQuarantineOnReturnShow quarantine procedure required upon returnboolean
showCollapseTravelRestrictionsMake the travel restrictions section collapsibleboolean
showTravelRestrictionsInitiallyCollapsedIf showCollapseTravelRestrictions is true, set the initial state of travel restrictions to collapsed or expandedboolean