Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

itemsapi

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

itemsapi

Javascript client for ItemsAPI

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ItemsAPI Javascript

Javascript client for ItemsAPI 2.0

Installation

npm install itemsapi

Run ItemsAPI

There are many easy ways to run ItemsAPI 2.0 server.

The simplest one is by using Docker:

docker run --privileged -it -p 3000:3000 itemsapi/itemsapi:latest

Getting started

Here is a quickstart for a search request

const ItemsAPI = require('itemsapi')

(async () => {
  const client = new ItemsAPI({
    host: 'http://127.0.0.1:3000'
  })

  const index = client.getIndex();

  let response = await index.updateConfig(config);
  response = await index.addItems(items);
  response = await index.search({
    per_page: 3,
    filters: {
      tags: ['epic']
    },
    facets_fields: ['tags']
  });
  console.log(response);
})();

API Resources

  • Make a search request:

await index.search(input)

  • List filters for specific facet:

await index.facet(input)

Index

  • Get index object:

client.getIndex()

Items

  • Add items:

await index.addItems(items)

  • Get item:

await index.getItem(id)

  • Update item partially:

await index.partialUpdateItem(id, data)

  • Update item:

await index.updateItem(id, data)

  • Delete item:

await index.deleteItem(id)

Configuration

  • Get configuration:

await index.getConfig()

  • Update configuration:

await index.updateConfig(config)

FAQs

Package last updated on 01 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc