Quickstarts
Node.js quickstart
Search with Node's built-in fetch against the OpenAPI search route.
Goal: use Node's built-in fetch to POST /v1/collections/{collection}/search
and receive HTTP 200 in under five minutes.
Set AEROSEARCH_BASE_URL to your Cell search host (without a route),
AEROSEARCH_API_KEY to a Project search key, and AEROSEARCH_COLLECTION to its Collection id.
Set AEROSEARCH_END_USER_TOKEN only when your server supplies a real end-user token.
Sample
// generated-from-contract: contracts/openapi/v1.yaml
// Node.js — searchCollectionPost
// POST /v1/collections/col_help/search (SearchRequest from contracts/openapi/v1.yaml)
const base = (process.env.AEROSEARCH_BASE_URL ?? "https://api.aerosearch.team").replace(/\/$/, "").replace(/\/v1$/, "");
const collection = process.env.AEROSEARCH_COLLECTION ?? "col_help";
const token = process.env.AEROSEARCH_END_USER_TOKEN;
const response = await fetch(base + "/v1/collections/" + encodeURIComponent(collection) + "/search", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.AEROSEARCH_API_KEY,
"Content-Type": "application/json",
...(token ? { "X-AeroSearch-End-User-Token": token } : {}),
},
body: JSON.stringify({ query: "reset password", limit: 10 }),
});
if (!response.ok) throw new Error("Search failed: " + response.status);
console.log(JSON.stringify(await response.json()));
Verify
From this repository, the local double verification executes the generated sample:
AEROSEARCH_BASE_URL=http://127.0.0.1:4418 AEROSEARCH_API_KEY=ask_search AEROSEARCH_COLLECTION=col_quickstart \
node tests/harness/quickstarts-daily/run.mjs node