{"_id":"@begrabby/booking-sdk","_rev":"6-71fac2b2cadfc3dc24d0ae3590980911","name":"@begrabby/booking-sdk","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"@begrabby/booking-sdk","version":"1.0.0","keywords":[],"author":"","license":"ISC","_id":"@begrabby/booking-sdk@1.0.0","maintainers":[{"name":"fabio.picheli","email":"fabio@begrabby.com"}],"dist":{"shasum":"f60bc67a194dbd7988f1bd04a6daa7bd8368e099","tarball":"https://registry.npmjs.org/@begrabby/booking-sdk/-/booking-sdk-1.0.0.tgz","fileCount":14,"integrity":"sha512-StYdYW3d/oqDnia6jntcQWfsvWntTytAmK3Xz8zeIR7PEBAFAy1M1VorVK6SALPFL257PRHG1rNrm5oZJkXutA==","signatures":[{"sig":"MEUCIQC7goHJxEp58284VgLJc7AobWhGKFvoo2pUE9KcCFVHlgIgNfMfucyeBKX9g7Rp6AJZ8Hh7bDm4cqc1GhEP4DMhs1s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26093},"main":"dist/grabby-sdk.umd.js","types":"dist/index.d.ts","module":"dist/grabby-sdk.es.js","gitHead":"7ce4347e850dcea467154fca3bbf952c9b4928b5","private":false,"scripts":{"dev":"vite","build":"tsc && vite build","preview":"vite preview","publish":"npm publish"},"_npmUser":{"name":"fabio.picheli","email":"fabio@begrabby.com"},"_npmVersion":"10.9.0","description":"Grabby Booking SDK","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^4.0.0","typescript":"^5.0.0","vite-plugin-dts":"^4.5.4"},"_npmOperationalInternal":{"tmp":"tmp/booking-sdk_1.0.0_1764337086991_0.8680798169767319","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@begrabby/booking-sdk","version":"1.0.1","keywords":[],"author":"","license":"ISC","_id":"@begrabby/booking-sdk@1.0.1","maintainers":[{"name":"fabio.picheli","email":"fabio@begrabby.com"}],"dist":{"shasum":"5a95db5604b51712d8f0157352ec87af3eabbd9a","tarball":"https://registry.npmjs.org/@begrabby/booking-sdk/-/booking-sdk-1.0.1.tgz","fileCount":14,"integrity":"sha512-RIDyphHuhLRSXGKDgWwHlIs9x9g099HIudF5j/3rsv9XUMaForWEW6hKcTQTLVoctd49aZl+GOvxYuuNuT+ywA==","signatures":[{"sig":"MEQCIA7YMxorltmJBlycjJ+GD0ye+ARUhE/Ugjkjvi7zuKZmAiB+WmRi1aytSQD5DRg9wdilic5XhSaxHgr+X1G/OcYjqQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26110},"main":"dist/grabby-sdk.umd.js","types":"dist/index.d.ts","module":"dist/grabby-sdk.es.js","gitHead":"7ce4347e850dcea467154fca3bbf952c9b4928b5","private":false,"scripts":{"dev":"vite","build":"tsc && vite build","preview":"vite preview","publish":"npm run build && npm publish"},"_npmUser":{"name":"fabio.picheli","email":"fabio@begrabby.com"},"_npmVersion":"10.9.0","description":"Grabby Booking SDK","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^4.0.0","typescript":"^5.0.0","vite-plugin-dts":"^4.5.4"},"_npmOperationalInternal":{"tmp":"tmp/booking-sdk_1.0.1_1764337148836_0.19867349646447474","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@begrabby/booking-sdk","version":"1.0.2","keywords":[],"author":"","license":"ISC","_id":"@begrabby/booking-sdk@1.0.2","maintainers":[{"name":"fabio.picheli","email":"fabio@begrabby.com"}],"homepage":"https://github.com/Be-Grabby/grabby-booking-sdk#readme","bugs":{"url":"https://github.com/Be-Grabby/grabby-booking-sdk/issues"},"dist":{"shasum":"74e43d8f83d4fde08c6667dc76b9d4f7f2613bda","tarball":"https://registry.npmjs.org/@begrabby/booking-sdk/-/booking-sdk-1.0.2.tgz","fileCount":14,"integrity":"sha512-n+a8P1LPBQJqodI+SFnkYFGMFN/sTqiYhxRwVFiytBfevwem2kkcPWUCFN+w180FuwXRiIfE53z7STbR/9UQGg==","signatures":[{"sig":"MEQCICFEjqI9+iBgM+W/Fkc+orWECQO4DDkYxakj5aps9iImAiBvKI+8CZZ64FBG5zTxf9tZqcJ9dziJRHVn+DAkWiZpvQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26210},"main":"dist/grabby-sdk.umd.js","types":"dist/index.d.ts","module":"dist/grabby-sdk.es.js","gitHead":"7ce4347e850dcea467154fca3bbf952c9b4928b5","private":false,"scripts":{"dev":"vite","push":"npm run build && npm publish","build":"tsc && vite build","preview":"vite preview"},"_npmUser":{"name":"fabio.picheli","email":"fabio@begrabby.com"},"repository":{"url":"git+https://github.com/Be-Grabby/grabby-booking-sdk.git","type":"git"},"_npmVersion":"10.9.0","description":"Grabby Booking SDK","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^4.0.0","typescript":"^5.0.0","vite-plugin-dts":"^4.5.4"},"_npmOperationalInternal":{"tmp":"tmp/booking-sdk_1.0.2_1764337193666_0.3744790111804015","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@begrabby/booking-sdk","version":"1.0.3","keywords":[],"author":"","license":"ISC","_id":"@begrabby/booking-sdk@1.0.3","maintainers":[{"name":"fabio.picheli","email":"fabio@begrabby.com"}],"homepage":"https://github.com/Be-Grabby/grabby-booking-sdk","bugs":{"url":"https://github.com/Be-Grabby/grabby-booking-sdk/issues"},"dist":{"shasum":"16a4333a19985bb99d41a7954b5cc3cfb0aa3c17","tarball":"https://registry.npmjs.org/@begrabby/booking-sdk/-/booking-sdk-1.0.3.tgz","fileCount":14,"integrity":"sha512-xW9XQYVpZ53sTLH3Yc5BkYNyKv+bqQFydUe0Vmj1QuVq27b+lLyuegOwKGGLiRQgx5+VYuep9+eZ+Y+NA7fWuw==","signatures":[{"sig":"MEQCID2RDuuHDeHFlh+xw3dOrScIXCWODdaM1xnux81mHApXAiBIzSmoGmnuTAkUW9uplAiCXrGSt9yZ6gnExl0HNqhpyQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26350},"main":"dist/grabby-sdk.umd.js","types":"dist/index.d.ts","module":"dist/grabby-sdk.es.js","gitHead":"7ce4347e850dcea467154fca3bbf952c9b4928b5","private":false,"scripts":{"dev":"vite","push":"npm run build && npm publish","build":"tsc && vite build","preview":"vite preview"},"_npmUser":{"name":"fabio.picheli","email":"fabio@begrabby.com"},"repository":{"url":"git+https://github.com/Be-Grabby/grabby-booking-sdk.git","type":"github"},"_npmVersion":"10.9.0","description":"Grabby Booking SDK","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^4.0.0","typescript":"^5.0.0","vite-plugin-dts":"^4.5.4"},"_npmOperationalInternal":{"tmp":"tmp/booking-sdk_1.0.3_1764337291947_0.08828431433142092","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@begrabby/booking-sdk","version":"1.1.0","keywords":[],"author":"","license":"ISC","_id":"@begrabby/booking-sdk@1.1.0","maintainers":[{"name":"fabio.picheli","email":"fabio@begrabby.com"}],"homepage":"https://github.com/Be-Grabby/grabby-booking-sdk","bugs":{"url":"https://github.com/Be-Grabby/grabby-booking-sdk/issues"},"dist":{"shasum":"fbb32a23343620b05affe91d113dedd1841a99a5","tarball":"https://registry.npmjs.org/@begrabby/booking-sdk/-/booking-sdk-1.1.0.tgz","fileCount":15,"integrity":"sha512-yx/AVUYZvr3FDvTIvqfNnvH4sX3SKC2SKTMUJgvy9v6ACrtp2lnZ94+zKeFV11wRUptkBl1vxMlu6yYWNp4fbw==","signatures":[{"sig":"MEUCIC7DYnGA4X1zKn2pSoQhdHaE29FNdQ7OlWh5DvF+abukAiEA527F38To9i0++NCuCeFDFhM+XVaHgoKLTopulx/0YRE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27985},"main":"dist/grabby-sdk.umd.js","types":"dist/index.d.ts","module":"dist/grabby-sdk.es.js","gitHead":"1f56d0e5e78a8fc28d94c6f00d0497fa7fb68c55","private":false,"scripts":{"dev":"vite","push":"npm run build && npm publish","build":"tsc && vite build","preview":"vite preview"},"_npmUser":{"name":"fabio.picheli","email":"fabio@begrabby.com"},"repository":{"url":"git+https://github.com/Be-Grabby/grabby-booking-sdk.git","type":"github"},"_npmVersion":"10.9.0","description":"Grabby Booking SDK","directories":{},"_nodeVersion":"22.12.0","_hasShrinkwrap":false,"devDependencies":{"vite":"^4.0.0","typescript":"^5.0.0","vite-plugin-dts":"^4.5.4"},"_npmOperationalInternal":{"tmp":"tmp/booking-sdk_1.1.0_1766831951122_0.053275473452035094","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@begrabby/booking-sdk","version":"1.1.1","description":"Grabby Booking SDK","main":"dist/grabby-sdk.umd.js","module":"dist/grabby-sdk.es.js","types":"dist/index.d.ts","repository":{"type":"github","url":"git+https://github.com/Be-Grabby/grabby-booking-sdk.git"},"homepage":"https://github.com/Be-Grabby/grabby-booking-sdk","bugs":{"url":"https://github.com/Be-Grabby/grabby-booking-sdk/issues"},"private":false,"scripts":{"dev":"vite","build":"tsc && vite build","preview":"vite preview","push":"npm run build && npm publish"},"keywords":[],"author":"","license":"ISC","devDependencies":{"typescript":"^5.0.0","vite":"^4.0.0","vite-plugin-dts":"^4.5.4"},"_id":"@begrabby/booking-sdk@1.1.1","gitHead":"1f56d0e5e78a8fc28d94c6f00d0497fa7fb68c55","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-yeU0+a/eCYBLn1Jw6mSuLaXKMf6ynSDylMRMKmaa7qNlGfKO8yXBy3BJ/Ru81UVbHI7vwyUDqQ1B25T1f4UlrA==","shasum":"c2fb635f283ef0f8e38ece93c58cf3fab9cc0db9","tarball":"https://registry.npmjs.org/@begrabby/booking-sdk/-/booking-sdk-1.1.1.tgz","fileCount":15,"unpackedSize":28155,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIE95+HdreFhycI9vpJNA28jdGIPGCNqjciPzh2cqVhNcAiBxfb/dZEKiavufdlw+9QuHv5levkXKbfkM7BvAQtFIug=="}]},"_npmUser":{"name":"fabio.picheli","email":"fabio@begrabby.com"},"directories":{},"maintainers":[{"name":"fabio.picheli","email":"fabio@begrabby.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/booking-sdk_1.1.1_1766832401073_0.6390681712683397"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-28T13:38:06.906Z","modified":"2025-12-27T10:46:41.391Z","1.0.0":"2025-11-28T13:38:07.176Z","1.0.1":"2025-11-28T13:39:09.021Z","1.0.2":"2025-11-28T13:39:53.865Z","1.0.3":"2025-11-28T13:41:32.142Z","1.1.0":"2025-12-27T10:39:11.300Z","1.1.1":"2025-12-27T10:46:41.200Z"},"bugs":{"url":"https://github.com/Be-Grabby/grabby-booking-sdk/issues"},"license":"ISC","homepage":"https://github.com/Be-Grabby/grabby-booking-sdk","keywords":[],"repository":{"type":"github","url":"git+https://github.com/Be-Grabby/grabby-booking-sdk.git"},"description":"Grabby Booking SDK","maintainers":[{"name":"fabio.picheli","email":"fabio@begrabby.com"}],"readme":"# Grabby Booking SDK\n\nThe Grabby Booking SDK allows you to easily integrate the Grabby booking interface into your website. You can embed it as an iframe in a container or display it as a modal overlay.\n\n## Installation\n\n### CDN\n\nAdd the following script tag to your HTML:\n\n```html\n<script type=\"module\" src=\"https://cdn.jsdelivr.net/gh/Be-Grabby/grabby-booking-sdk/dist/grabby-sdk.umd.js\"></script>\n```\n\n### NPM\n\n```bash\nnpm install @begrabby/booking-sdk\n```\n\n## Quick Start\n\n```html\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"UTF-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n  <title>Grabby Booking</title>\n  <script type=\"module\" src=\"https://cdn.jsdelivr.net/gh/Be-Grabby/grabby-booking-sdk/dist/grabby-sdk.umd.js\"></script>\n</head>\n<body>\n  <div id=\"booking-container\" style=\"width: 100%; height: 600px;\"></div>\n\n  <script type=\"module\">\n    const grabby = new window.Grabby('YOUR_ACCOUNT_ID', {\n      lang: 'en',\n      url: 'https://app.begrabby.com'\n    });\n\n    grabby.render('#booking-container');\n  </script>\n</body>\n</html>\n```\n\n## API Reference\n\n### Constructor\n\n```javascript\nnew Grabby(accountId, options)\n```\n\n#### Parameters\n\n- **accountId** (string, required): Your Grabby account ID\n- **options** (object, required): Configuration options\n\n#### Options\n\n| Option | Type | Description |\n|--------|------|-------------|\n| `url` | string | Base URL for the booking interface (default: `https://app.begrabby.com`) |\n| `lang` | string | Language code (e.g., `'en'`, `'es'`, `'de'`) |\n| `compact` | boolean | Enable compact mode for smaller displays |\n| `returnUrl` | string | URL to redirect after booking completion |\n| `isIframe` | boolean | Enable iframe mode |\n| `hideFooter` | boolean | Hide the footer in the booking interface |\n| `isGiftCardOpen` | boolean | Open gift card section by default |\n| `colorPrimary` | string | Primary color (hex without `#`, e.g., `'fe6913'`) |\n| `colorAccent` | string | Accent color (hex without `#`) |\n| `color` | string | Text color (hex without `#`) |\n| `background` | string | Background color (hex without `#`) |\n| `bannerUrl` | string | URL to custom banner image |\n| `logoUrl` | string | URL to custom logo image |\n\n### Methods\n\n#### `render(selector, openOptions?)`\n\nRenders the booking interface inside a container element.\n\n```javascript\ngrabby.render('#booking-container', {\n  productId: 'product-uuid',\n  compact: true\n});\n```\n\n**Parameters:**\n- `selector` (string): CSS selector for the container element\n- `openOptions` (object, optional): Additional options to override constructor options\n\n#### `showModal(openOptions?)`\n\nDisplays the booking interface in a modal overlay.\n\n```javascript\ngrabby.showModal({\n  productId: 'product-uuid',\n  eventId: 'event-uuid',\n  compact: true\n});\n```\n\n**Parameters:**\n- `openOptions` (object, optional): Additional options to override constructor options\n\n#### `close()`\n\nCloses the modal or removes the iframe.\n\n```javascript\ngrabby.close();\n```\n\n### Open Options\n\nWhen calling `render()` or `showModal()`, you can pass additional options:\n\n| Option | Type | Description |\n|--------|------|-------------|\n| `productId` | string | Pre-select a specific product |\n| `eventId` | string | Pre-select a specific event |\n| `visitDate` | string | Pre-select a visit date (in the format DD-MM-YYYY, e.g., `'31-12-2024'`) |\n| `preselectGiftCardAmount` | number | Pre-select gift card amount |\n\nAll constructor options can also be passed here to override the default configuration.\n\n## Examples\n\n### Basic Embedded Widget\n\n```html\n<div id=\"booking-container\" style=\"width: 100%; height: 600px;\"></div>\n\n<script type=\"module\">\n  const grabby = new window.Grabby('YOUR_ACCOUNT_ID', {\n    lang: 'en'\n  });\n\n  grabby.render('#booking-container');\n</script>\n```\n\n### Modal with Custom Styling\n\n```html\n<button id=\"book-now\">Book Now</button>\n\n<script type=\"module\">\n  const grabby = new window.Grabby('YOUR_ACCOUNT_ID', {\n    lang: 'en',\n    colorPrimary: 'fe6913',\n    colorAccent: '1E1F21',\n    bannerUrl: 'https://example.com/banner.png',\n    logoUrl: 'https://example.com/logo.png'\n  });\n\n  document.getElementById('book-now').addEventListener('click', () => {\n    grabby.showModal();\n  });\n</script>\n```\n\n### Pre-select Product\n\n```html\n<button id=\"book-product\">Book Specific Product</button>\n\n<script type=\"module\">\n  const grabby = new window.Grabby('YOUR_ACCOUNT_ID', {\n    lang: 'en'\n  });\n\n  document.getElementById('book-product').addEventListener('click', () => {\n    grabby.showModal({\n      productId: 'fdfbd428-7d39-4819-969f-01823d01958d',\n      compact: true,\n      isIframe: true\n    });\n  });\n</script>\n```\n\n### Gift Card Purchase\n\n```html\n<button id=\"buy-gift-card\">Buy Gift Card</button>\n\n<script type=\"module\">\n  const grabby = new window.Grabby('YOUR_ACCOUNT_ID', {\n    lang: 'en'\n  });\n\n  document.getElementById('buy-gift-card').addEventListener('click', () => {\n    grabby.showModal({\n      isGiftCardOpen: true,\n      preselectGiftCardAmount: 50\n    });\n  });\n</script>\n```\n\n## Events\n\nThe SDK automatically listens for messages from the booking interface:\n\n- **booking.close**: Closes the modal/iframe\n- **booking.redirect**: Opens a redirect URL in a new tab\n- **booking.css**: Adjusts iframe height dynamically\n\nThese events are handled automatically by the SDK.\n\n## Browser Support\n\n- Modern browsers (Chrome, Firefox, Safari, Edge)\n- ES6+ support required\n- Module script support required\n\n## License\n\nISC\n","readmeFilename":"README.md"}