@sinequa/atomic

Install

Add the package, pick the right entry point, and know which module format you are getting.

npm
npm install @sinequa/atomic

Node 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.

.
spfx
Import fromUse it when
@sinequa/atomicEverywhere: browser, Node, Angular, React, a web component.
@sinequa/atomic/spfxInside 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.

src/webpart.ts
// 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:

SharePoint only
npm install @microsoft/sp-http --save-peer

See SharePoint Framework for the full setup.

Module formats

Both are published, and your bundler picks one from the exports map:

FormatFileChosen by
ESMdist/atomic.jsBundlers and import in Node
CJSdist/atomic.cjsrequire()

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:

src/check.ts
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.

What's next

On this page