Install
Add the package, pick the right entry point, and know which module format you are getting.
npm install @sinequa/atomicNode 18 or later, or any current browser. The package has no runtime dependencies — nothing else is installed with it.
Entry points
There are two, and the difference matters only in SharePoint.
| Import from | Use it when |
|---|---|
@sinequa/atomic | Everywhere: browser, Node, Angular, React, a web component. |
@sinequa/atomic/spfx | Inside a SharePoint Framework web part, where requests must travel through the host's AadHttpClient. |
The spfx entry point re-exports everything from the root one and adds the SharePoint transport, so a web
part imports from it exclusively rather than mixing the two.
// Everything the root entry point offers, plus the SharePoint transport.
import { createAtomicClient, createSpfxHttpAdapter } from "@sinequa/atomic/spfx";Its peer dependency is optional — install it only for that case:
npm install @microsoft/sp-http --save-peerSee SharePoint Framework for the full setup.
Module formats
Both are published, and your bundler picks one from the exports map:
| Format | File | Chosen by |
|---|---|---|
| ESM | dist/atomic.js | Bundlers and import in Node |
| CJS | dist/atomic.cjs | require() |
Type declarations ship alongside, so nothing needs @types/*.
The library is written as free functions and plain objects, with no side effects at import time beyond module
evaluation — so a bundler drops what you do not use. Importing filter alone does not pull in the preview or
audit code.
Verifying the install
This is the smallest thing that proves the package resolves and the types are visible. It makes no network call, so it works before any server configuration exists:
import { AuthMode, filter } from "@sinequa/atomic";
// A filter is a plain object — no client, no configuration, no request.
console.log(filter.eq("docformat", "pdf"));
// { field: 'docformat', operator: 'eq', value: 'pdf' }
console.log(AuthMode.credentials().kind);
// 'credentials'If your editor resolves filter and AuthMode and the script prints those two lines, the install is sound and
everything left to configure is on the server side.