Use Node.js 20, 22, or 24. The client targets Solr 8.x, 9.x, and 10.x. Integration evidence is operation-specific and is recorded in the API coverage matrix and compatibility policy; do not infer support for every Solr endpoint from the target version range.
Install the package:
npm install node-solr-lambdaCreate a client. Set the Solr base URL and exactly one core or collection name.
import { createSolrClient } from "node-solr-lambda";
const solr = createSolrClient({
baseUrl: "http://localhost:8983",
core: "catalog"
});
const result = await solr.query({ query: "*:*", limit: 10 });
console.log(result);The client does not create a core or collection. Create it on the Solr server before sending requests.
The package provides separate ESM and CommonJS runtime exports. Node.js selects the matching entry point.
ESM:
import { createSolrClient } from "node-solr-lambda";
const solr = createSolrClient({ collection: "catalog" });CommonJS:
const { createSolrClient } = require("node-solr-lambda");
const solr = createSolrClient({ collection: "catalog" });TypeScript consumers use conditional declarations for the selected module system. The package also keeps a top-level types entry for TypeScript tooling that does not use NodeNext package conditions.
Validation is disabled by default. Zod is an optional peer dependency; install it only when using application-defined input/output schemas:
npm install zodSee runtime validation for configuration and examples.