Getting started

To get started, simply include the Javascript SDK on your page and run the init() command with the app key provided to you as below.

<script src="https://connect.boka.se/sdk/sdk_all.js"></script>
<script>
    Boka.init({
        app: 'your_app_key'
    });
</script>

By including the file named sdk_all.js, all modules in the SDK is included.

Modular alternative

The Boka Connect SDK is also available in a modular form, allowing you to specifiy only the functions needed for your application.

The SDK core functions must however always be included before including any modules, as in the example below.

<script src="https://connect.boka.se/sdk/sdk.js"></script>
/* Include booking module and calendar module */
<script src="https://connect.boka.se/sdk/modules/booking/boka.booking.js"></script>
<script src="https://connect.boka.se/sdk/modules/calendar/boka.calendar.js"></script>
<script>
    Boka.init({
        app: 'your_app_key'
    });
</script>

For a complete list of modules and script paths, please visit the Modules section

Without SDK

To communicate against the API without the ease of our SDK, such as from your back end. You need to add two headers to your calls.

Key Value
X-Boka-Api-Key Your app key.
Authorization The string Bearer <access_token>.

The access_token identifies the currently authenticated user against the API and is available from the login callback parameters obtained during the login procedure.

The login procedure must as of now be facilitated using the SDKs login() function.

Public endpoints

A few selected procedures in the API are accessible publicly and does not required the above authorization header. These procedures resides under the /public URI and are marked with a * in this documentation.