1.0.5 • Published 4 years ago

@rapidaccess/js v1.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

RapidAccess Search API client for JavaScript

This API client allows you to intract with RapidAccess API endpoints.

Getting Started

First, install RapidAccess JavaScript API Client via the npm package manager:

npm install @rapidaccess/js

Then, create objects on your index:

const RapidAccess = require("@rapidaccess/js");

const client = RapidAccess.client("YourAPIKey");
const index = client.initIndex("yourIndexName");

const objectId = 'resourceId'
const object = {
  name: "Foo",
  description: "Bar"
}
const rules = [{
  country: ["AU", "US"]
}]

index
  .createObject(objectId, object, rules)
  .then(({ objectId }) => {
    console.log(objectID);
  })
  .catch(err => {
    console.log(err);
  });

Finally, let's actually search using the search method:

index
  .search("Fo", [country: "AU"], {page: 0, limit: 100})
  .then(({ results }) => {
    console.log(results);
  })
  .catch(err => {
    console.log(err);
  });
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

4 years ago

1.0.0

4 years ago