kuzzle-sdk
Official Javascript SDK for Kuzzle
Last updated a month ago by kuzzle .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install kuzzle-sdk 
SYNC missed versions from official npm registry.

undefined

About

Kuzzle Javascript SDK

This is the official Javascript SDK for the free and open-source backend Kuzzle. It provides a way to dial with a Kuzzle server from Javascript applications using protocols.

Multiprotocols

Currently, the SDK provides 2 protocols: Http and WebSocket. WebSocket protocol implement the whole Kuzzle API, while the HTTP protocol does not implement realtime features (rooms and subscriptions).

Promises based

All SDK methods return a promise resolving the result part of Kuzzle API responses. If an error occurs, the promise is rejected with an Error object embedding the error part of the API response.
For example, for the action create of the controller collection (collection:create), the property result contains { "acknowledged": true } . This is therefore what will be returned by the SDK method if successful.
Any error must be caught either at the end of the Promise chain, or by using async/await and a try...catch.

:books: Documentation

Kuzzle

Kuzzle is an open-source backend that includes a scalable server, a multiprotocol API, an administration console and a set of plugins that provide advanced functionalities like real-time pub/sub, blazing fast search and geofencing.

Get trained by the creators of Kuzzle :zap:

Train yourself and your teams to use Kuzzle to maximize its potential and accelerate the development of your projects.
Our teams will be able to meet your needs in terms of expertise and multi-technology support for IoT, mobile/web, backend/frontend, devops.
:point_right: Get a quote

Usage

Compatibility matrix

Kuzzle Version SDK Version
1.x.x 5.x.x
1.x.x 6.x.x
2.x.x 7.x.x

Getting started :point_right:

Installation

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

Node.js

npm install kuzzle-sdk

Browser

To run the SDK in the browser, you have to build it yourself by cloning this repository and running

$ npm install
$ npm run build

A dist directory will be created, containing a browser version of this SDK.

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

or use the CDN:

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/kuzzle-sdk@latest/dist/kuzzle.min.js"></script>

Then the Kuzzle SDK will be available under the KuzzleSDK variable:

  <script>
    const kuzzle = new KuzzleSDK.Kuzzle(
      new KuzzleSDK.WebSocket('localhost')
    );
    // ...
  </script>

Browser with Webpack

If you use Webpack, you'll likely use the NPM-packaged version of the SDK (like in Node)

npm install kuzzle-sdk

But you'll still need to pick the built version (which ships with the package).

// with the classic require...
const { Kuzzle } = require('kuzzle-sdk')
// ... or with the new import directive.
import { Kuzzle } from 'kuzzle-sdk'

Example

The SDK supports different protocols. When instantiating, you must choose the protocol to use and fill in the different options needed to connect to Kuzzle.

const { Kuzzle,  WebSocket } = require('kuzzle-sdk');
const kuzzle = new Kuzzle(
  new WebSocket('localhost', { port: 7512 })
);

try {
  await kuzzle.connect();
  const serverTime = await kuzzle.server.now();
  console.log(serverTime);
} catch (error) {
  console.error(error);
}

Current Tags

  • 7.2.0                                ...           latest (a month ago)

126 Versions

  • 7.2.0                                ...           a month ago
  • 7.1.4                                ...           a month ago
  • 7.1.3                                ...           2 months ago
  • 7.1.2                                ...           2 months ago
  • 7.1.1                                ...           2 months ago
  • 7.1.0                                ...           3 months ago
  • 6.2.8                                ...           6 months ago
  • 7.0.1                                ...           6 months ago
  • 7.0.0                                ...           6 months ago
  • 6.2.7                                ...           6 months ago
  • 6.2.6                                ...           7 months ago
  • 7.0.0-beta.2                                ...           7 months ago
  • 6.2.5                                ...           7 months ago
  • 7.0.0-beta.1                                ...           8 months ago
  • 6.2.4                                ...           8 months ago
  • 6.2.3                                ...           8 months ago
  • 6.2.2                                ...           8 months ago
  • 6.2.1                                ...           9 months ago
  • 6.2.0                                ...           10 months ago
  • 6.1.4                                ...           a year ago
  • 6.1.3                                ...           a year ago
  • 6.1.2                                ...           a year ago
  • 6.1.1                                ...           a year ago
  • 6.1.0                                ...           a year ago
  • 6.0.0                                ...           a year ago
  • 5.0.15                                ...           a year ago
  • 6.0.0-beta-8                                ...           a year ago
  • 6.0.1-beta-7                                ...           a year ago
  • 6.0.0-beta-7                                ...           a year ago
  • 6.0.0-beta-6                                ...           a year ago
  • 6.0.0-beta-5                                ...           a year ago
  • 5.0.14                                ...           a year ago
  • 6.0.0-beta-3                                ...           2 years ago
  • 6.0.0-beta-2                                ...           2 years ago
  • 5.0.13                                ...           2 years ago
  • 5.0.12                                ...           2 years ago
  • 5.0.11                                ...           2 years ago
  • 5.0.10                                ...           3 years ago
  • 5.0.9                                ...           3 years ago
  • 5.0.8                                ...           3 years ago
  • 5.0.7                                ...           3 years ago
  • 5.0.6                                ...           3 years ago
  • 5.0.5                                ...           3 years ago
  • 5.0.4                                ...           3 years ago
  • 5.0.3                                ...           3 years ago
  • 5.0.1                                ...           3 years ago
  • 5.0.0                                ...           3 years ago
  • 4.0.1                                ...           3 years ago
  • 4.0.0                                ...           3 years ago
  • 3.4.2                                ...           3 years ago
  • 3.4.1                                ...           3 years ago
  • 3.4.0                                ...           3 years ago
  • 3.2.0                                ...           3 years ago
  • 3.1.2                                ...           3 years ago
  • 3.1.1                                ...           3 years ago
  • 3.1.0                                ...           3 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 2.3.4                                ...           3 years ago
  • 2.3.3                                ...           3 years ago
  • 2.3.2                                ...           3 years ago
  • 2.3.1                                ...           3 years ago
  • 2.3.0                                ...           3 years ago
  • 2.2.1                                ...           3 years ago
  • 2.2.0                                ...           4 years ago
  • 2.1.5                                ...           4 years ago
  • 2.1.4                                ...           4 years ago
  • 2.1.3                                ...           4 years ago
  • 2.1.2                                ...           4 years ago
  • 2.1.1                                ...           4 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.3                                ...           4 years ago
  • 2.0.2                                ...           4 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.9.3                                ...           4 years ago
  • 1.9.2                                ...           4 years ago
  • 1.9.1                                ...           4 years ago
  • 1.9.0                                ...           4 years ago
  • 1.8.0                                ...           4 years ago
  • 1.7.4                                ...           4 years ago
  • 1.7.3                                ...           4 years ago
  • 1.7.2                                ...           4 years ago
  • 1.7.1                                ...           4 years ago
  • 1.7.0                                ...           4 years ago
  • 1.6.4                                ...           4 years ago
  • 1.6.3                                ...           4 years ago
  • 1.6.2                                ...           4 years ago
  • 1.6.1                                ...           4 years ago
  • 1.6.0                                ...           4 years ago
  • 1.4.4                                ...           4 years ago
  • 1.4.3                                ...           4 years ago
  • 1.4.2                                ...           4 years ago
  • 1.4.1                                ...           4 years ago
  • 1.4.0                                ...           4 years ago
  • 1.3.9                                ...           4 years ago
  • 1.3.8                                ...           4 years ago
  • 1.3.7                                ...           4 years ago
  • 1.3.6                                ...           4 years ago
  • 1.3.5                                ...           4 years ago
  • 1.3.4                                ...           4 years ago
  • 1.3.3                                ...           4 years ago
  • 1.3.2                                ...           4 years ago
  • 1.3.1                                ...           4 years ago
  • 1.3.0                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.9                                ...           4 years ago
  • 1.0.8                                ...           4 years ago
  • 1.0.7                                ...           4 years ago
  • 1.0.6                                ...           4 years ago
  • 1.0.5                                ...           4 years ago
  • 1.0.4                                ...           4 years ago
  • 1.0.3                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 1.0.0-alpha.7                                ...           5 years ago
  • 1.0.0-alpha.6                                ...           5 years ago
  • 1.0.0-alpha.5                                ...           5 years ago
  • 1.0.0-alpha.4                                ...           5 years ago
  • 1.0.0-alpha.3                                ...           5 years ago
  • 1.0.0-alpha.2                                ...           5 years ago
  • 1.0.0-alpha.1                                ...           5 years ago
  • 0.2.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 159
Dependencies (2)
Dev Dependencies (20)

Copyright 2014 - 2016 © taobao.org |