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

AttributeDescriptionRequired
tenantIdId to identify the widget user.Yes
salesChannelIdThe id of the sales channel to load.Yes
termsConditionsUrlUrl to your terms and conditions. The user has to accept those on the checkout page.Yes
privacyPolicyUrlUrl to your privacy policy. The user has to accept those on the checkout page.Yes
logoUrlUrl to your logo to show on the checkout page.Yes
analyticsArray of analytics providers.No
enableCartEnable shopping cart support, default: falseNo
allowErrorReportingEnable error reporting. Recommended to set true, default falseNo

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>