appbaseio / appbase-js

appbase.io search client library for JavaScript
MIT License
42 stars 18 forks source link
appbase elasticsearch javascript

Build Status Image

appbase-js
appbase-js

appbase-js is a universal JavaScript client library for working with the appbase.io database, for Node.JS and Javascript (browser UMD build is in the dist/ directory); compatible with elasticsearch.js.

An up-to-date documentation for Node.JS API is available at http://docs.appbase.io/javascript/quickstart.

TOC

  1. appbase-js: Intro
  2. Features
  3. Live Examples
  4. Installation
  5. Docs Manual
  6. Other Projects You Might Like


1. appbase-js: Intro

appbase-js is a universal JavaScript client library for working with the appbase.io database.

2. Features

It can:

It can't:

Appbase.io - the database service is opinionated about cluster setup and hence doesn't support the Elasticsearch devops APIs. See rest.appbase.io for a full reference on the supported APIs.

3. Live Examples


Check out the Live interactive Examples at reactiveapps.io.


image

4. Installation

We will fetch and install the appbase-js lib using npm. 4.0.0-beta is the most current version.

npm install appbase-js

Adding it in the browser should be a one line script addition.

<script
  defer
  src="https://unpkg.com/appbase-js/dist/appbase-js.umd.min.js"
></script>

Alternatively, a UMD build of the library can be used directly from jsDelivr.

To write data to appbase.io, we need to first create a reference object. We do this by passing the appbase.io API URL, app name, and credentials into the Appbase constructor:

var appbaseRef = Appbase({
  url: "https://appbase-demo-ansible-abxiydt-arc.searchbase.io",
  app: "good-books-demo",
  credentials: "c84fb24cbe08:db2a25b5-1267-404f-b8e6-cf0754953c68",
});

OR

var appbaseRef = Appbase({
  url: "https://c84fb24cbe08:db2a25b5-1267-404f-b8e6-cf0754953c68@appbase-demo-ansible-abxiydt-arc.searchbase.io",
  app: "good-books-demo",
});

Credentials can also be directly passed as a part of the API URL.

5. Docs Manual

For a complete API reference, check out JS API Ref doc.

6. Other Projects You Might Like

⬆ Back to Top