Which one do I use?
- Use
@moss-dev/moss-webfor 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/mossfor server-side (Node.js) workloads, such as API routes, backend services, and pipelines.
Differences
@moss-dev/moss-web (Browser) | @moss-dev/moss (Node) | |
|---|---|---|
| Environment | Modern browsers, runs on WebAssembly | Node.js server-side |
| Where queries run | Locally in the browser after loadIndex | Server-side runtime |
| Sessions | Not supported | Coming soon |
| File parsing | Documents and files from the browser | Server-side file handling |
| Persistence | In-browser, per device | Server-side |
| Credentials | Use a custom authenticator; never ship a projectKey in client code | projectKey can be used directly in trusted server code |