Search.io SDK for Node
The official Search.io Node client library.
Search.io offers a search and discovery service with Neuralsearch®, the world's first instant AI search technology. Businesses of all sizes use Search.io to build site search and discovery solutions that maximize e-commerce revenue, optimize on-site customer experience, and scale their online presence.
Table of contents
Quickstart
Before you begin
- Create a Search.io account
- 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 { CollectionsClient, withKeyCredentials } from "@sajari/sdk-node";
const client = new CollectionsClient(
withKeyCredentials("account-key-id", "account-key-secret")
);
async function createCollection(id, displayName) {
const collection = await client.createCollection({ id, displayName });
console.log(`Collection ${collection.displayName} created.`);
await client.deleteCollection(collection.id);
}
createCollection("collection-id", "Collection display name").catch(
console.error
);
Examples
Examples are in the examples directory.
Contributing
Contributions are welcome. See the Contributing guide.
License
MIT
See LICENSE