Overview

Dtravel JavaScript SDK

The Dtravel SDK provides multiple widgets to help you integrate booking and property discovery features into your website. Each widget is designed for specific use cases and can be easily embedded or displayed as a floating overlay.

Choose the widget that best fits your needs:

Available Widgets

v1

Booking Widget (Legacy)

The original Dtravel booking widget for direct property bookings. Stable and production-ready.

  • Direct property booking
  • Date and guest selection
  • Payment integration
View Demo
v2

Booking Widget v2

Enhanced booking widget with additional features.

  • Floating and embedded modes
  • Auto-Open feature
View Demo
New

Property Search Widget

Browse and search through all of a host's properties with advanced filtering capabilities.

  • Display all host properties
  • Filter by dates and guests
  • Property grid with images
  • Click to book any property
  • Portfolio showcase
View Demo

Getting Started

Quick Integration

All Dtravel widgets can be integrated with a single script tag. Choose your widget below:

Booking Widget v1

<script id="dtravel_jssdk"
  src="https://sdk.dtravel.com/static/dtravel.sdk.js?userId=YOUR_USER_ID&propertyId=YOUR_PROPERTY_ID">
</script>

Booking Widget v2

<script id="dtravel_jssdk"
  src="https://sdk.dtravel.com/static/v2/dtravel.sdk.js?userId=YOUR_USER_ID&propertyId=YOUR_PROPERTY_ID">
</script>

Property Search Widget

<script id="dtravel_search_jssdk"
  src="https://sdk.dtravel.com/static/v2/dtravel-search.sdk.js?userId=YOUR_USER_ID">
</script>

Widget Comparison

Feature Booking v1 Booking v2 Search Widget
Direct Property Booking
Browse All Properties
Date Filtering
Guest Count Filter
Floating Mode
Embedded Mode
Best For Legacy sites Direct booking Portfolio showcase

Support & Resources

Documentation

Each widget has its own detailed documentation page with complete examples and API references:

Common Issues

Widget not appearing: Ensure the userId parameter is provided in the script URL.

CORS errors: Make sure you're serving from the correct domain and protocol (HTTPS in production).

Functions not available: Wait for the SDK script to fully load before calling widget functions.

Browser Support

All widgets support modern browsers including:

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)
  • Mobile browsers (iOS Safari, Chrome Mobile)

Get Help

For technical support or questions, contact the Dtravel team: