Skip to main content

Configurations

Overview

This module provides functionality for managing global configuration settings essential for connecting to the Sinequa platform. It includes:

  • A global configuration object with default values for API paths and backend URLs
  • A function to set and customize the global configuration
  • Various configuration options to control authentication methods, user overrides, logging, and API interactions

These tools allow developers to centralize and easily adjust application-wide settings, ensuring consistent configuration across the application for seamless integration with Sinequa services.

globalConfig

This object contains the global configuration to enable connection to the Sinequa platform.

info

By default the globalConfig object contains the following values:

{ 
"apiPath": "api/v1",
"loginPath": "/login",
"backendUrl": window.location.origin
}
AppGlobalConfig Type
export type AppGlobalConfig = {
app: string;
backendUrl: string;
apiPath: string;
autoOAuthProvider: string;
autoSAMLProvider: string;
loginPath: string;
userOverride: {
username: string;
domain: string;
};
userOverrideActive: boolean;
useCredentials: boolean; // when true, the credentials are sent with the request
useSSO: boolean; // when true, SSO is used
useCredentialsOrSSO: boolean; // when true, maybe SSO or credentials are used
useSAML: boolean; // when true, SAML is used even if OAuth is available
logLevel: LogLevel; // controls the application log level
};

Example

example-config.ts
import { globalConfig } from "@sinequa/atomic";

console.log("configuration", globalConfig);
// Output: { apiPath: "api/v1", loginPath: "/login", backendUrl: <your-current-url> }

setGlobalConfig()

Sets the global configuration for the application.
Use this function when you need to customize the global configuration within your application.

parametertypedescription
configPartial<AppGlobalConfig>The partial configuration object to be merged with the existing global configuration.

Example

example-get-global-config.ts
import { globalConfig, setGlobalConfig } from "@sinequa/atomic";

// update the configuration with the `app` property
setGlobalConfig({ app: "training" })

const conf = globalConfig;
// will display: { app: "training", apiPath: "api/v1", loginPath: "/login", backendUrl: <your-current-url> }

Configuration Schema


Summary Table

PropertyPurpose
appSinequa application name
backendUrlURL of the backend server
apiPathAPI path for requests
autoOAuthProviderName of the OAuth provider
autoSAMLProviderName of the SAML provider
loginPathLogin path
userOverrideUser override credentials (username, domain)
userOverrideActiveWhether user override is active
useCredentialsUse credentials for authentication
useSSOUse SSO for authentication
useCredentialsOrSSOUse SSO or credentials for authentication
useSAMLUse SAML even if OAuth is available
logLevelApplication log level

Note:

  • All properties are optional when calling setGlobalConfig, but the full type is shown above for reference.
  • The actual globalConfig object may contain additional properties for extensibility.