SDK
SDK Javascript v6.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

Constructor #

Use this constructor to create a new instance of the SocketIO protocol with specific options.

Arguments #

Copied to clipboard!
SocketIO(host, [options]);

Argument Type Description
host
string
Kuzzle server hostname or IP
options
object
SocketIO connection options

options #

SocketIO protocol connection options.

Property Type
(default)
Description
port
number

(7512)
Kuzzle server port
sslConnection
boolean

(false)
Use SSL to connect to Kuzzle server
autoReconnect
boolean

(true)
Automatically reconnect to kuzzle after a disconnected event
reconnectionDelay
number

(1000)
Number of milliseconds between reconnection attempts

Return #

A SocketIO protocol instance.

Usage #

Copied to clipboard!
// Loads the SocketIO protocol
const
  {
    Kuzzle,
    SocketIO
  } = require('kuzzle-sdk');
const options = {
  autoReconnect: false
};
// Instantiates the SocketIO protocol
const socketIOProtocol = new SocketIO('kuzzle', options);
// Use it with Kuzzle
const kuzzle = new Kuzzle(socketIOProtocol);