· 6 years ago · Feb 11, 2020, 03:30 PM
1Advanced Instructions requires some javascript knowledge (if you want to create your own styled link/button, open to a particular date, launch on pageload, etc.):
2To use our widget you'll need to include our script
3<script src="https://widgets.resy.com/embed.js"></script>
4
5You can then optionally set up a global config that will apply to any calls to the widget. This is useful if you have multiple widgets on the page.
6resyWidget.config(configObject);
7
8The config object has the following properties:
9
10venueId (required) - this is our internal id for the venue. The venue id for 3AKE is 10067.
11apiKey (required) - the apiKey is needed for proper attribution and special permissions. Your api key is 0MYIGVyhQjfNKiRu5jkUtjjuGLUXxFel
12date (optional) - passing a date string in YYYY-MM-DD format will default the page to that date when it loads. If the date is in the past or too far in the future it will revert to today.
13seats (optional) - passing a number will default the page to that number of seats
14replace (optional) - when passed with a value of true to resyWidget.addButton will replace rather than append to the target
15There are two methods to add the widget.
16This code will append a <span> with a Resy branded graphic button that has a click handler to launch the widget.
17resyWidget.addButton(target, config);
18
19target can be a DOM object, array, or array-like collection (HTMLCollection or jQuery). If global config has been set up, the config argument is optional and any properties here will override the properties set up by call to resyWidget.config.
20
21This code can be used to trigger the widget from your own javascript. For example in a click handler or on page load.
22resyWidget.openModal(config);
23
24Again config is optional if global config has been set up and properties present will override the global config.