Skip to main content

Version: 22.04

Space Configuration

Workspaces takes a bespoke approach to configuration. We encourage the use of TypeScript to write config definitions, providing architects with better validation and error handling, while keeping configurations modular and making them extendable.

The example application template comes with a set of configs that include default values for common use cases, so you don't need to start from scratch when creating your config files even if you are developing a new solution. Nevertheless, it can be helpful to have a high-level understanding of how the configurations are designed and implemented.

Keeping a well maintained configs folder makes it easier for you to modify, extend and upgrade your Workspaces solution.

Structure and Usage

Inside each sub-folder under src/configs there is an index.ts that imports all the other files in the folder. The example below imports the global config and several space configs. The space configs don't need to be imported using the names shown in the example, but whatever names you use will be the names of the spaces in the app.

src/configs/custom/index.ts
import global from './global';
import manage from './manage';
import process from './process';
import helpdesk from './helpdesk';
import assistedChannel from './assistedChannel';

const spaces = [process, helpdesk, assistedChannel, manage];

export default {
global,
spaces,
};

All exports are lowercase, representing the space IDs to be used by global.ts in its spaces configuration. The global export is the only mandatory export. To learn more about config definitions, see Global Configuration and Current Space Configuration.

Once you have decided what config and fixture best suit your needs, it's time to copy them and create new folders called src/configs/custom and src/fixtures/custom, and import them inside src/index.ts. Your browser will reload, serving your new config.