← Back

Introducing our new JavaScript library

·
1,545 Views

We love JavaScript at Splitbee. Especially when it's typed. Interacting with a library through the window is not how we prefer to do things. We know we are not alone with this. Welcome our new improved JavaScript library to the family.

 

🙌 Available instantly. No need to wait for Splitbee to load.

🔥 Auto-complete support.

💫 It automatically injects Splitbee.js for you.

 

In the process, Splitbee.js got fine-tuned as well. This lead to a fair reduction in bundle size. This means our analytics script is now less than 3kb. Your already great page-speed is might be even better now.

 

Get started with the new library

You can install the package today from NPM. The source is available on GitHub, if you want to have look.

yarn add @splitbee/web
 

That it, start using it in your frontend apps like this:

import splitbee from "@splitbee/web"
splitbee.init() // Injects Splitbee.js for you
splitbee.track("Sign Up") // Use Splitbee like you're used to

For further reference, have a look at our docs.

 

This is not a replacement for Splitbee.js

This library adds some sweet improvements on-top of the script you already use. There is no need to use it if you don't gain any benefit from the things described above.

 
 

One more thing 🤫

We are actively working on a privacy-mode that doesn't require any cookies. Best of all: You can start using it today. This means more privacy for your visitors, and less cookie-banners for your website.

 

Get started with the cookie-less beta

You can enable the new cookie-less mode by adding the data-no-cookie attribute to the Splitbee script tag.

<script async data-no-cookie src="https://cdn.splitbee.io/sb.js"></script>
 

If you are using the new JavaScript library, you can enable it like this:

import splitbee from "@splitbee/web"
splitbee.init({
disableCookie: true
})
 
ℹ️
Be aware that this affects the accuracy of your data. Visitors are no longer tracked across multiple days.
 

We will release a detailed blog post about this, once we figured out all details and what this means for privacy.

 

 

As always, we'd love to hear your feedback! Follow us on Twitter and let us know what you want to see next.

 
 
 
Timo Lins portrait
Timo Lins
Splitbee Co-Founder