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
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:
- Booking Widget v1 Documentation
- Booking Widget v2 Documentation
- Property Search Widget Documentation
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:
- Email: [email protected]