Liquit.Initialize
  • 22 Jan 2020
  • 1 Minute to read
  • Dark
    Light
  • PDF

Liquit.Initialize

  • Dark
    Light
  • PDF

The initialize functions allows you to connect to the Liquit Workspace, this function is used to determine the version of the targeted Liquit Workspace Zone. When the version of the targeted Liquit Workspace Zone is determined the Liquit Workspace API will translate the API calls to the correct syntax/endpoints.

Usage

By default the Liquit Workspace API will auto-detect the version of the targeted Liquit Workspace Zone. However it is possible to only support certain version, you can force supported versions by using the method below:

The following parameters are available for the API:

Name Description Default value
version Version number of the API layer to use, will auto-detect if not set or configured to null. null
relogin A custom login process to execute when a session has expired. This can be used to trigger a new Liquit.Login/Liquit.SSO call. Will refresh the page if this option is not configured. null
token Specify a previously issued token provided by Login/SSO functions. That will be reused for the current session, if invalid or expired, relogin will be triggered on first API call. null

Below you will find a small example of code to initialize the Liquit Workspace APIs

Liquit.Initialize('https://workspace.liquit.com', {
  version: 3,
  relogin: function () { console.log('Session has expired'); },
  token: null
});

When a incorrect server version is specified the API call will return a error, this will not be returned by the Initialize function.

Was this article helpful?