Configurations
To be able to use the widgets you need to add some configurations. All the configurations variables are mandatory today to make the widgets work on your website. The configuration snippet has to be added alongside with the other scripts initialization.
The configuration has to be set in the <head>
of your web page.
<script>
window.blendConfig = {
// configs can be added here.
};
</script>
Attributes
Attribute | Description | Required |
---|---|---|
tenantId | Id to identify the widget user. | Yes |
salesChannelId | The id of the sales channel to load. | Yes |
termsConditionsUrl | Url to your terms and conditions. The user has to accept those on the checkout page. | Yes |
privacyPolicyUrl | Url to your privacy policy. The user has to accept those on the checkout page. | Yes |
logoUrl | Url to your logo to show on the checkout page. | Yes |
analytics | Array of analytics providers. | No |
enableCart | Enable shopping cart support, default: false | No |
allowErrorReporting | Enable error reporting. Recommended to set true , default false | No |
Example
Add the configuration script alongside the two other snippets.
<link rel="stylesheet" href="https://widgets.blendbooking.com/assets/index.css" />
<script src="https://widgets.blendbooking.com/assets/index.js" async type="module"></script>
<!-- Blend widget configurations -->
<script>
window.blendConfig = {
tenantId: 'xxxxxxxx-XXXX-XXXX-XXXX-xxxxxxxxxxxx',
salesChannelId: 1,
termsConditionsUrl: 'https://example.com/legal/terms-and-conditions',
privacyPolicyUrl: 'https://example.com/legal/privacy-policy',
logoUrl: 'https://example.com/logo.svg',
analytics: [],
enableCart: true,
};
</script>