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

@sajari/sdk-node

Package Overview
Dependencies
Maintainers
5
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sajari/sdk-node

[![Build status](https://github.com/sajari/sdk-node/workflows/Build/badge.svg?branch=master)](https://github.com/sajari/sdk-node/actions)

  • 4.0.0-alpha.9
  • npm
  • Socket score

Version published
Weekly downloads
456
increased by4.35%
Maintainers
5
Weekly downloads
 
Created
Source

Sajari SDK for Node

Build status

The official Sajari Node client library.

Sajari is a smart, highly-configurable, real-time search service that enables thousands of businesses worldwide to provide amazing search experiences on their websites, stores, and applications.

Table of contents

Quickstart

Before you begin

  1. Create a Sajari account
  2. Retrieve your account credentials

Install the SDK

npm install @sajari/sdk-node

Use the SDK

The following example shows how to create a collection using the SDK.

⚠️ The function below cleans up after itself by deleting the collection immediately after creation.

// Import the Sajari SDK.
import { CollectionsClient, withKeyCredentials } from "@sajari/sdk-node";

// Create a client for working with collections from account key credentials.
const client = new CollectionsClient(
  withKeyCredentials("account-key-id", "account-key-secret")
);

async function createCollection(id, displayName) {
  // Create a new collection.
  const collection = await client.createCollection({ id, displayName });
  console.log(`Collection ${collection.displayName} created.`);

  // Clean up. Remove this in your application to keep the collection.
  await client.deleteCollection(collection.id);
}

createCollection("collection-id", "Collection display name").catch(
  console.error
);

Examples

Examples are in the examples directory.

ExampleSource code
Batch create schema fieldssource code
Batch upsert recordssource code
Create collectionsource code
Create pipelinesource code
Create schema fieldsource code
Delete collectionsource code
Delete recordsource code
Generate pipelinessource code
Get collectionsource code
Get pipelinesource code
Get recordsource code
List collectionssource code
List pipelinessource code
List schema fieldssource code
Upsert recordsource code
Query collectionsource code
Set default pipelinesource code
Get default pipelinesource code
Set default pipeline versionsource code
Get default pipeline versionsource code

Contributing

Contributions are welcome. See the Contributing guide.

License

MIT

See LICENSE

FAQs

Package last updated on 15 Dec 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