@docslurp/contrib-algolia-server
Server-side wrapper for syncing Algolia-style settings, synonyms, rules and imports into DocSlurp.
bash
pnpm add @docslurp/contrib-algolia-serverOn this page
@docslurp/contrib-algolia-server
Package docs · GitHub · npm
Sync Algolia-style settings, synonyms, rules and imports into DocSlurp from a backend job, migration script or API adapter. createDocSlurpAlgoliaServerClient() wraps @docslurp/contrib-search-compat/algolia and adds searchIndex, syncSettings, syncSynonyms and syncRules. Use it with a server key; writes are refused for browser keys.
Install and use
bash
pnpm add @docslurp/contrib-algolia-serverts
import { createDocSlurpAlgoliaServerClient } from "@docslurp/contrib-algolia-server";
const client = createDocSlurpAlgoliaServerClient({
apiUrl: "https://docslurp.io",
clientKey: process.env.DOCSLURP_API_KEY!, // A server key. The option is named clientKey.
});
const res = await client.searchIndex("product-manuals", { query: "invoice" });
await client.syncSynonyms("product-manuals", [{ type: "synonym", synonyms: ["invoice", "bill"] }]);The index name is a DocSlurp workspace slug, UUID or default. For browser search, use @docslurp/contrib-search-compat with a browser key; see the Algolia compatibility guide.
License
MIT (see LICENSE), like the client packages such as @docslurp/contrib-search-compat.