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
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();import { InjectionToken, inject, provideAppInitializer } from "@angular/core";
import { type AtomicClient, createAtomicClient } from "@sinequa/atomic";
import { environment } from "../environments/environment";
export const SINEQUA = new InjectionToken<AtomicClient>("Sinequa client", {
// AtomicClientConfig accepts every application configuration key, so an
// environment object can be spread in without a cast.
factory: () => createAtomicClient({ ...environment.sinequa }),
});
export function provideSinequa() {
return provideAppInitializer(async () => {
const client = inject(SINEQUA);
await client.initializeConfig();
await client.auth.login();
});
}import { createAtomicClient } from "@sinequa/atomic";
export const sinequa = createAtomicClient({
// Both keys are optional: served from the Sinequa origin under /app/<name>,
// the client derives them from the page URL.
app: import.meta.env.VITE_SINEQUA_APP,
backendUrl: import.meta.env.VITE_SINEQUA_URL,
uiLanguage: navigator.language.slice(0, 2),
});
export const ready = (async () => {
await sinequa.initializeConfig();
await sinequa.auth.login();
})();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.
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:
| Key | What actually controls this |
|---|---|
logLevel | configureLogger({ level }) — see Logging |
loginPath | Your own router. The library never navigates to it. |
createRoutes | Nothing 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.