@sinequa/atomic

Configuration

Which keys matter, what the server resolves for you, and the three keys that are read by nothing.

Two keys get you running: where the server is, and which application to use. Everything else has a working default or is decided by the server.

Setting it

Configuring a client
src/sinequa.ts
import { AuthMode, createAtomicClient } from "@sinequa/atomic";

export const sinequa = createAtomicClient({
  app: "<your-app>",
  backendUrl: "https://<your-sinequa-server>",

  // Optional. Omit it and the server's pre-login response decides.
  authMode: AuthMode.unknown(),

  // Sent as `ui-language`, and as the request `locale`.
  uiLanguage: "en",
});

// Later changes are merged, not replaced.
sinequa.configure({ uiLanguage: "fr" });

await sinequa.initializeConfig();

The free-function equivalent is setGlobalConfig(...), which merges into globalConfig — the configuration the default client reads. See The client.

What initializeConfig() resolves

It is not optional bookkeeping: it fills in what you left out and settles how to authenticate.

yes no initializeConfig() backendUrl ??= page originapp ??= /app/<name> from the URL authMode alreadycredentials? no request:a form needs no server input GET api/v1/app?preLogin=true detectAuthMode(config, preLogin) authMode settledproviders recorded

Precedence when settling the mode: an explicit authMode other than unknown always wins, then bearerToken, then an OAuth provider, then a SAML provider, then unknown. So declaring the mode is how you override what the server announces.

Keys

Prop

Type

auth — the authentication layer's own options

Prop

Type

See Handling a 401 for the hook, and Testing for the injectable trio.

Keys that do nothing

Three keys exist on the configuration type and are read by nothing in this library. They are declared for applications and framework integrations built on top of it, which may consume them:

KeyWhat actually controls this
logLevelconfigureLogger({ level }) — see Logging
loginPathYour own router. The library never navigates to it.
createRoutesNothing here. A flag for a layer above.

Setting logLevel and expecting quieter logs is the one that costs people time.

Pitfalls

What's next

One key is worth setting deliberately

aggregationCounts is the only key whose absence silently degrades a feature: without it the library assumes ten values per facet, and a facet configured otherwise reports "load more" wrongly in both directions. One call at start-up fixes it — see Aggregations.

On this page