Technical Documentation
Widget installation
Integrate the booking widget on your website in minutes
4 min min read
The booking widget allows your customers to make bookings directly from your website.
Get the code
- Go to Widget → Code in the sidebar menu
- Copy the integration code
- Your unique
clientIdis already included
Integration options
Option 1: Full page (recommended)
The widget takes up the entire page, ideal for a dedicated booking experience.
<!-- Add this in the <head> of your page -->
<script src="https://widget.reservadehamacas.com/embed.js"></script>
<!-- Add this where you want the widget -->
<div id="reserva-hamacas-widget"></div>
<script>
ReservaHamacas.init({
clientId: 'YOUR_CLIENT_ID',
container: '#reserva-hamacas-widget'
});
</script>
Selecciona para copiar
Option 2: Floating button
A button that opens the widget in a modal.
<script src="https://widget.reservadehamacas.com/embed.js"></script>
<script>
ReservaHamacas.init({
clientId: 'YOUR_CLIENT_ID',
mode: 'floating-button',
buttonText: 'Book Sun Lounger',
buttonPosition: 'bottom-right'
});
</script>
Selecciona para copiar
Option 3: Direct link
Send your customers directly to the booking page:
https://reserva.reservadehamacas.com/YOUR_CLIENT_ID
Selecciona para copiar
Use it in:
- Emails
- Social media
- Printed QR codes
Specific integrations
WordPress
- Install the "Insert Headers and Footers" plugin (or similar)
- Paste the widget code in the footer section
- Create a new page for bookings
- Add the container
<div>
You can also use a custom HTML block in the block editor.
Wix
- Go to your site editor
- Add an "Embed" > "Custom HTML" element
- Paste the complete widget code
- Adjust the container size
Squarespace
- Go to the page where you want the widget
- Add a "Code" block
- Paste the widget code
- Save and publish
Shopify
- Go to Online Store > Pages
- Create a new page
- Switch to HTML editor
- Paste the widget code
Verify installation
- Visit the page where you installed the widget
- You should see the booking calendar
- Try making a test booking
Troubleshooting
Widget doesn't appear
- Verify the
clientIdis correct - Check the browser console (F12) for errors
- Make sure the container exists in the HTML
Widget appears but doesn't load data
- Verify your account is active
- Check that you have at least one published zone
- Verify you have available sun loungers
CORS error
- The widget must be loaded from a public domain
- Doesn't work opening the HTML file directly (file://)
Technical requirements
| Requirement | Minimum |
|---|---|
| JavaScript | Enabled |
| HTTPS | Recommended |
| Browsers | Chrome, Firefox, Safari, Edge (latest 2 versions) |
Next step
Learn to customize the widget with colors and options.