Socket
Socket
Sign inDemoInstall

@sajari/sdk-node

Package Overview
Dependencies
2
Maintainers
5
Versions
49
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sajari/sdk-node


Version published
Maintainers
5
Created

Readme

Source

sajari-sdk-node

Table of contents:

  • Quickstart
  • Samples
  • Contributing

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

// Import the Sajari SDK.
const { CollectionsClient, withKeyCredentials } = require("@sajari/sdk-node");

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

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

  // Clean up.
  await client.deleteCollection(collection.id);
}

createCollection().catch(console.error);

Contributing

Contributions are welcome. See the Contributing guide.

FAQs

Last updated on 07 Sep 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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc