Skip to main content
Browser SDK / Browser vs Node Moss ships two JavaScript clients. They share a similar API surface but target different environments. Pick the one that matches where your code runs.

Which one do I use?

  • Use @moss-dev/moss-web for client-side, in-browser search. Queries run locally on WebAssembly, so once an index is loaded there are no server round-trips and no data leaves the device.
  • Use @moss-dev/moss for server-side (Node.js) workloads, such as API routes, backend services, and pipelines.
// In the browser
import { MossClient } from "@moss-dev/moss-web";

// On the server (Node.js)
import { MossClient } from "@moss-dev/moss";

Differences

@moss-dev/moss-web (Browser)@moss-dev/moss (Node)
EnvironmentModern browsers, runs on WebAssemblyNode.js server-side
Where queries runLocally in the browser after loadIndexServer-side runtime
SessionsNot supportedComing soon
File parsingDocuments and files from the browserServer-side file handling
PersistenceIn-browser, per deviceServer-side
CredentialsUse a custom authenticator; never ship a projectKey in client codeprojectKey can be used directly in trusted server code
Both clients require an index to be loaded before querying. In the browser SDK, call loadIndex before query.