Skip to content

Aeppic.Features

In order to control certain implementation features within aeppic we employ feature flags.

Each feature flag currently available is listed under features in the Default Configuration.

INFO

Features are loaded initially after login or when not logged in but a connection to the server is configured. They are reloaded on every login/logout.

load()

Load or refresh all features flags from the server. It uses the /api/v4/features/aeppic endpoint by default and stores the last loaded values in local storage which it falls back to in case it encounters errors reading from the server.

isEnabled(name)

This checks whether a feature is enabled. It also logs a warning if that feature is marked as deprecated.

js
const canUseFeature = Aeppic.Features.isEnabled('feature-tag-name')

use(name)

This checks whether a feature is enabled. It also throws an exception if the feature is not enabled and a warning if the feature is marked as deprecated.

js
Aeppic.Features.use('feature-tag-name')

getOptionsFor(name)

This reads the configured options for a feature. It also marks a feature as being used (see use), but doesn't throw if the feature is disabled.

js
const options = Aeppic.Features.getOptionsFor('feature-tag-name')