node package manager

kuzzle-sdk

Build Status codecov.io Dependency Status

Official Kuzzle Javascript SDK

About Kuzzle

A backend software, self-hostable and ready to use to power modern apps.

You can access the Kuzzle repository on Github

Basic usage

Follow Kuzzle Guide

SDK Documentation

The complete SDK documentation is available here

Report an issue

Use following meta repository to report issues on SDK:

https://github.com/kuzzleio/kuzzle-sdk/issues

Protocols used

The Javascript SDK implements two network protocols: raw WebSocket, and Socket.IO
The main reason behind this is that while Socket.IO offers better compatibility with older web browsers, our raw WebSocket implementation is about 20% faster

Which protocol is used when you connect to Kuzzle depends on multiple factors:

NodeJS

The protocol used is always raw WebSocket.

Web Browsers

The SDK will first try to use raw WebSocket to connect to Kuzzle. If the web browser does not support this protocol, then the SDK falls back to Socket.IO

Installation

This SDK can be used either in NodeJS or in a browser.

NodeJS

npm install kuzzle-sdk --save

Javascript

Clone this github repository and run npm run build. A dist directory will be created, containing a browser version of this SDK.

<script type="text/javascript" src="dist/kuzzle.js"></script>

If you want to support older browser versions, you may load socket.io before Kuzzle, making the SDK compatible with browsers without websocket support:

<!-- Don't forget to include socketio before Kuzzle SDK -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.3/socket.io.slim.js"></script>

License

Apache 2