Installation & Setup
Install resytech.js via script tag, NPM, or CDN and configure it for your site.
Script Tag (Recommended)
Include the library directly in your HTML. Add data-resytech-* attributes to auto-initialize a ResytechClient instance:
<script
src="https://static.resytech.com/js/resytech.js"
data-resytech-location-id="YOUR_LOCATION_ID"
data-resytech-base-url="https://booking.yourdomain.com"
data-resytech-debug="true">
</script>This automatically:
- Creates a
ResytechClientinstance with your configuration - Exposes it as
window.resytech - Binds click handlers to any elements with
data-resytech-activity-idordata-resytech-equipment-idattributes
Script Tag Data Attributes
| Attribute | Required | Description |
|---|---|---|
data-resytech-location-id | Yes | Your Resytech location UUID |
data-resytech-base-url | Yes | Base URL of your booking platform (e.g. https://booking.yourdomain.com) |
data-resytech-debug | No | Set to "true" to enable console logging |
NPM / ES Modules
Install from NPM:
npm install resytech-client-libImport the classes you need:
import { ResytechClient, ResytechApi, ResytechBlogRenderer } from 'resytech-client-lib';
const client = new ResytechClient({
locationId: 'YOUR_LOCATION_ID',
baseUrl: 'https://booking.yourdomain.com'
});CDN
Load directly from the Resytech CDN:
<script src="https://static.resytech.com/js/resytech.js"></script>If you omit the data-resytech-* attributes on the script tag, no auto-initialization occurs. You can then create instances manually in your own JavaScript.
Global Exports
When loaded via script tag, the library exposes these globals on window:
| Global | Type | Description |
|---|---|---|
window.ResytechClient | Class | The booking widget class |
window.ResytechApi | Class | The API client class |
window.ResytechBlogRenderer | Class | The blog renderer class |
window.resytech | Instance | Auto-initialized ResytechClient instance (only when data-resytech-location-id and data-resytech-base-url are set on the script tag) |
Manual Initialization
If you prefer not to use auto-initialization, create a client instance yourself:
const client = new ResytechClient({
locationId: 'YOUR_LOCATION_ID',
baseUrl: 'https://booking.yourdomain.com',
theme: {
primaryColor: '#007bff',
fontFamily: 'Inter, sans-serif'
},
debug: false
});The ResytechApi client is configured separately:
const api = new ResytechApi({
baseUrl: 'https://api.bookingui.com/v1',
cmsBaseUrl: 'https://cms.bookingui.com',
debug: true,
timeout: 30000
});Next Steps
- ResytechClient Reference -- full widget API
- Embedding the Booking UI -- data attributes and pre-fill options
- ResytechApi Reference -- building custom flows
