Quick start

How to include the embed script in your application

Add the script tag

This can be anywhere on your page, but it is recommended to put it in the head of your document.

<script src="https://embed.travelbase.nl/embed.js"></script>

Add a container for the embed

At the place where you want the embed to show up, create a html element with a unique id/class so you can reference it later.

<div id="root"></div>

Initialize your embed

Initalize the embed with the following code. Replace https://demo.travelbase.nl with the url of the travelbase instance you're using.

<script>
    Travelbase.embed('#root', {
        originUrl: 'https://demo.travelbase.nl',
        type: 'search',
        options: {
            // ...
        },
        callbacks: {
            // ...
        },
    });
</script>

🎉 Done!

You should now see the embed on your page.

The options/callbacks are different for each type of embed, so make sure to check the documentation for the specific embed type you want to use.

On this page