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>
Environment | endUrl |
---|---|
Sandbox | Provided in custom integration guide |
Production | Provided 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.type | Description |
---|---|
sdkLoaded | SDK javascript is loaded |
iframeStartLoading | Integration iframe started loading |
iframeSuccess | Iframe loaded successfully |
iframeFailure | Iframe loading issue |
orderSuccess | User successfully placed an order |
orderDecline | User declined the order |
modalClose | User 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.
Language | Code | Visa Information | COVID Travel Restrictions |
---|---|---|---|
English | en | Supported | Supported |
Spanish | es | Supported | Supported |
German | de | Supported | - |
French | fr | Supported | - |
Arabic | ar | Supported | - |
Danish | dk | Supported | - |
Finnish | fi | Supported | - |
Icelandic | is | Supported | - |
Dutch | nl | Supported | - |
Norwegian | no | Supported | - |
Polish | pt | Supported | - |
Russian | ru | Supported | - |
Swedish | sw | Supported | - |
Simplified Chinese | zh | Supported | - |
Features
Feature Flag | Description | Type |
---|---|---|
showDestinationSelector | Show/hide select destination UI | boolean |
showDepartureDateSelector | Show/hide select departure date UI | boolean |
showPassportSelector | Show/hide select passport UI | boolean |
showOriginSelector | Show/hide select origin UI | boolean |
showSubscribe | Show subscribe to alerts button | boolean |
showQuarantineOnReturn | Show quarantine procedure required upon return | boolean |
showCollapseTravelRestrictions | Make the travel restrictions section collapsible | boolean |
showTravelRestrictionsInitiallyCollapsed | If showCollapseTravelRestrictions is true , set the initial state of travel restrictions to collapsed or expanded | boolean |
Updated over 3 years ago