Skip Navigation

IModulePreferencesService

Allows to read and save web module specific preference.

Each user may have different preferences for the same web module. Preferences are read and saved for currently logged user.

Preferences are stored in JSON format. Size of stored preferences is limited.

Preferences are stored in Sabre and are persisted between sessions.

Warning
Preferences storage is not PCI nor GDPR compliant, it must not be used to store sensitive data.
Preferences storage does not comply with the PCI DSS (Payment Card Industry Data Security Standard) or the GDPR (General Data Protection Regulation). Data stored in this storage may not meet the security and privacy requirements mandated by these standards.

Usage

In order to be used, the IModulePreferencesService has to be imported:

import { IModulePreferencesService } from 'sabre-ngv-preferences/services/IModulePreferencesService';

Once imported, it can be obtained in a standard way:

const prefService: IModulePreferencesService = getService(IModulePreferencesService);

The service provides two methods:

getPreferences(): Promise<object>;

setPreferences(pref: object): Promise<void>;
Note
More information about the service and its usage are available in TypeScript API Documentation of sabre-ngv-preferences module.
Note
com.sabre.redapp.example3.web.configuration, com.sabre.redapp.example3.web.settings.multipage and com.sabre.redapp.example3.web.settings.singlepage SDK sample projects contains examples of using the service.