SDK Configuration

The following section describe all the configuration parameters and methods that are available for the Search SDK.

Configuration options

The following table shows available InbentaSearchSDK parameters:

Name Type Default Description
apiURL string null Defines the URL of the search endpoint. If defined, it avoids the initial request to /apis for the sole purpose of getting the URL of the search endpoint when creating the Client using createFromAccessToken.
autoRefresh boolean true Defines whether or not the client gets a new token when the current one expires. If set to false, the client does not automatically call /refreshToken or /auth when the token expires.
connectionEntryPoint string https://api.inbenta.io/ This parameter defines the Inbenta API endpoint where the SDK is going to perform the Auth connection. You can select any available endpoint from the ones defined in Regions and Endpoints.
environment string production Defines the source environment from Search App's knowledge base. It uses an x-inbenta-env header. For more information about this header, see the API Routes.
expirationTime integer null Defines the Unix timestamp when the token should expire. If defined, it avoids the initial request to /refreshToken when creating the Client using createFromAccessToken.
labels object Override the default texts used in components. Each component has its own default labels that can be overriden. For more information, see the components section. See the list of all SDK labels for their customization or translation.
skin string space-cowboy Defines the components appearance (skin). For more information, see the CSS Guide.
source string null Source identifier (e.g. facebook, mobile, etc.) used to filter the logs in the Dashboards. It uses an x-inbenta-source header to make API requests.
userType integer 0 Defines the profiles identifier from the Search App's Knowledge Base. It uses an x-inbenta-user-type header to make API requests. For more information about this header, see the API Routes.

Methods

The SDK offers several methods to perform actions.

Name Method Static Description
createFromAccessToken createFromAccessToken(accessToken: String, apiKey: String, config: Object = {}): SDK Yes Creates a new SDK, using the API Key and an access token obtained from the /auth endpoint.
createFromDomainKey createFromDomainKey(domainKey: String, apiKey: String, config: Object = {}): SDK Yes Creates a new SDK, using the API Key and a domain key.
getSessionId getSessionId(): String No Obtains the Session Id of the current session.
setCallbackWhenInvalidAccessToken setCallbackWhenInvalidAccessToken(callback: function) No Allows to provide a custom functionality in case the AccessToken is not valid.