Location hierarchy
City, region and country layers are always eligible when HI has hostels there.
One hosted HI search component for cities, regions, countries and hostels—with a mobile interface designed for the software keyboard.
The widget downloads HI’s public location index, searches it in the visitor’s browser and hands a chosen place to Hostel Explorer. It supports city, region and country results as well as hostel-name matching.
HI hosts the component and location data centrally. Member Associations do not need an API key, a software package or a locally hosted copy of the JavaScript.
On mobile, focusing the field opens a full-page search interface. Its results area scrolls independently and remains usable while the software keyboard is visible.
The old widget remains supported during migration. An MA can stage and approve the replacement normally, then roll back to its saved legacy embed if its own CMS or security policy causes a problem.
City, region and country layers are always eligible when HI has hostels there.
A focused interface with its own results scrolling above the keyboard.
Updates and current location data arrive without an MA reinstalling the widget.
Replace YOUR_MA_CODE with the code supplied by HI. Keep the fallback link inside the component.
Get the MA partner code, language and tab behaviour from HI.
Place the component in normal page flow and include the module script once.
Complete the staging checklist, publish, then repeat the mobile smoke test.
<hi-hostel-search
index-url="https://widgets.hihostels.com/v1/locations.json"
search-url="https://widgets.hihostels.com/go/hostels"
locale="en-GB"
partner="YOUR_MA_CODE"
target="_blank">
<a href="https://www.hihostels.com/discover/explore">Search HI hostels</a>
</hi-hostel-search>
<script type="module" src="https://widgets.hihostels.com/v1/widget.js"></script>
If the widget appears more than once on a page, include the script only once. Do not download, proxy or self-host the component.
partnerThe non-personal attribution code supplied by HI. Use lowercase letters, numbers and hyphens—for example djh.
localeUse en-GB for English or de-DE for German. Standard copy follows this setting.
targetUse _blank to open Explorer in a new tab, recommended for an external MA site, or _self for the same tab.
placeholder and button-label can override standard interface text by agreement with HI. Overrides are not automatically translated.
This is the same hosted component and live location index an MA will embed. Search for Paris, a country, or a region you know.
Paris.source=ma-widget.The unchanged legacy widget is currently supported by HI’s compatibility service. MAs can schedule and test the replacement normally.
HI intends to maintain the legacy compatibility endpoints for at least 12 months after cutover and until measured use is negligible. HI will communicate before withdrawing support.
Keep a CMS revision or exact copy of the old embed.
Do not show both search interfaces in the same location.
Include a real phone with the keyboard open.
Check the public page in a private browser window.
Restore the saved legacy embed, publish it, then send HI the evidence below.
Add the widget host to existing directives; do not replace the MA’s current sources or nonces.
script-src https://widgets.hihostels.com
connect-src https://widgets.hihostels.comThe browser must also be allowed to navigate to widgets.hihostels.com and www.hihostels.com. The widget does not require unsafe-eval.
Suggestions are filtered locally after the public index downloads. The submitted location, language, source=ma-widget and non-personal partner code appear in the destination query string.
Do not put names, email addresses, customer IDs or other personal data in widget attributes.
The widget targets current evergreen desktop and mobile browsers, including current Safari on iOS and Chrome on Android. Each MA should still test its own supported matrix.
The fallback link remains available if JavaScript cannot run.
Place the component in normal flow in a container that can use the available width. Do not clip it or give its outer container a fixed height.
Shadow DOM isolates internal styling from the host site.
First compare the MA page with the hosted test above. If the hosted test works but the MA embed does not, include the MA page’s console or CSP error.
Embed file, installation guide, QA, rollback, technical notes and support template.
↘