55 <a href =" https://travis-ci.org/kuzzleio/sdk-javascript " >
66 <img src="https://travis-ci.org/kuzzleio/sdk-javascript.svg?branch=master"/>
77 </a >
8- <a href =" https://codecov.io/gh/kuzzleio/sdk-javascript " >
9- <img src="https://codecov.io/gh/kuzzleio/sdk-javascript/branch/master/graph/badge.svg" />
10- </a >
118 <a href =" https://david-dm.org/kuzzleio/sdk-javascript " >
129 <img src="https://david-dm.org/kuzzleio/sdk-javascript.svg" />
1310 </a >
@@ -24,8 +21,8 @@ This is the official Javascript SDK for the free and open-source backend Kuzzle.
2421
2522#### Multiprotocols
2623
27- Currently, the SDK provides 2 protocols: __ Http and WebSocket.__
28- WebSocket protocol implement the whole Kuzzle API, while the HTTP protocol does not implement realtime features (rooms and subscriptions).
24+ Currently, the SDK provides 2 protocols: ** Http and WebSocket.**
25+ WebSocket protocol implement the whole Kuzzle API, while the HTTP protocol does not implement realtime features (rooms and subscriptions).
2926
3027#### Promises based
3128
@@ -42,11 +39,10 @@ Any error must be caught either at the end of the `Promise` chain, or by using `
4239Kuzzle is an open-source backend that includes a scalable server, a multiprotocol API,
4340an administration console and a set of plugins that provide advanced functionalities like real-time pub/sub, blazing fast search and geofencing.
4441
45- * :octocat: __ [ Github] ( https://github.com/kuzzleio/kuzzle ) __
46- * :earth_africa : __ [ Website] ( https://kuzzle.io ) __
47- * :books : __ [ Documentation] ( https://docs.kuzzle.io ) __
48- * :email : __ [ Discord] ( http://join.discord.kuzzle.io ) __
49-
42+ - :octocat: ** [ Github] ( https://github.com/kuzzleio/kuzzle ) **
43+ - :earth_africa : ** [ Website] ( https://kuzzle.io ) **
44+ - :books : ** [ Documentation] ( https://docs.kuzzle.io ) **
45+ - :email : ** [ Discord] ( http://join.discord.kuzzle.io ) **
5046
5147## Get trained by the creators of Kuzzle :zap :
5248
@@ -59,36 +55,38 @@ Our teams will be able to meet your needs in terms of expertise and multi-techno
5955## Compatibility matrix
6056
6157| Kuzzle Version | SDK Version |
62- | ---------------- | ------------- |
58+ | -------------- | ----------- |
6359| 1.x.x | 5.x.x |
6460| 1.x.x | 6.x.x |
6561| 2.x.x | 7.x.x |
6662
6763## Getting started :point_right :
6864
69- - [ Node.js] ( https://docs.kuzzle.io/sdk/js/7/getting-started/node-js/ )
70- - [ Browser] ( https://docs.kuzzle.io/sdk/js/7/getting-started/raw-web/ )
71- - [ Webpack] ( https://docs.kuzzle.io/sdk/js/7/getting-started/webpack/ )
72- - [ React/Redux] ( https://docs.kuzzle.io/sdk/js/7/getting-started/react/with-redux/ )
73- - [ Vue.js] ( https://docs.kuzzle.io/sdk/js/7/getting-started/vuejs/standalone/ )
65+ - [ Node.js] ( https://docs.kuzzle.io/sdk/js/7/getting-started/node-js/ )
66+ - [ Browser] ( https://docs.kuzzle.io/sdk/js/7/getting-started/raw-web/ )
67+ - [ Webpack] ( https://docs.kuzzle.io/sdk/js/7/getting-started/webpack/ )
68+ - [ React/Redux] ( https://docs.kuzzle.io/sdk/js/7/getting-started/react/with-redux/ )
69+ - [ Vue.js] ( https://docs.kuzzle.io/sdk/js/7/getting-started/vuejs/standalone/ )
7470
7571### Installation
7672
7773This SDK can be used either in NodeJS or in a browser.
7874
79- #### Node.js
75+ #### Node.js
8076
8177```
8278npm install kuzzle-sdk
8379```
8480
8581#### Browser
8682
87- To run the SDK in the browser, you have to build it yourself by cloning this repository and running
83+ To run the SDK in the browser, you have to build it yourself by cloning this repository and running
84+
8885``` bash
8986$ npm install
9087$ npm run build
91- ````
88+ ```
89+
9290A ` dist ` directory will be created, containing a browser version of this SDK.
9391
9492``` html
@@ -98,18 +96,19 @@ A `dist` directory will be created, containing a browser version of this SDK.
9896or use the CDN:
9997
10098``` html
101- < script type=" text/javascript" src=" https://cdn.jsdelivr.net/npm/kuzzle-sdk@latest/dist/kuzzle.min.js" ></script>
99+ <script
100+ type =" text/javascript"
101+ src =" https://cdn.jsdelivr.net/npm/kuzzle-sdk@latest/dist/kuzzle.min.js"
102+ ></script >
102103```
103104
104105Then the Kuzzle SDK will be available under the ` KuzzleSDK ` variable:
105106
106107``` html
107- < script>
108- const kuzzle = new KuzzleSDK.Kuzzle(
109- new KuzzleSDK.WebSocket(' localhost' )
110- );
111- // ...
112- < /script>
108+ <script >
109+ const kuzzle = new KuzzleSDK.Kuzzle (new KuzzleSDK.WebSocket (" localhost" ));
110+ // ...
111+ </script >
113112```
114113
115114#### Browser with Webpack
@@ -124,21 +123,19 @@ But you'll still need to pick the built version (which ships with the package).
124123
125124``` javascript
126125// with the classic require...
127- const { Kuzzle } = require(' kuzzle-sdk' )
126+ const { Kuzzle } = require (" kuzzle-sdk" );
128127// ... or with the new import directive.
129- import { Kuzzle } from ' kuzzle-sdk'
128+ import { Kuzzle } from " kuzzle-sdk" ;
130129```
131130
132131### Example
133132
134- The SDK supports different protocols. When instantiating,
135- you must choose the protocol to use and fill in the different options needed to connect to Kuzzle.
133+ The SDK supports different protocols. When instantiating,
134+ you must choose the protocol to use and fill in the different options needed to connect to Kuzzle.
136135
137136``` js
138- const { Kuzzle, WebSocket } = require(' kuzzle-sdk' );
139- const kuzzle = new Kuzzle(
140- new WebSocket(' localhost' , { port: 7512 })
141- );
137+ const { Kuzzle , WebSocket } = require (" kuzzle-sdk" );
138+ const kuzzle = new Kuzzle (new WebSocket (" localhost" , { port: 7512 }));
142139
143140try {
144141 await kuzzle .connect ();
0 commit comments