Skip Navigation

Nudge

Overview

Important
Please be aware that Nudge is available only for Private Red Apps

In-line encouragement also known as Nudge is a SR360 widget acting as an extension to the current "decision support bar".

image

The Nudge widget is only available in the following response drawers:

  • Air Shopping

  • Flights Shopping

  • Air Availability

  • Sell

  • Pricing

  • Hotel

  • Car

Workflow

This simplified chart illustrates how Nudge is used in SR360 and how it is decided whether the widget should be displayed in a response drawer or not based on the data that is present in the response drawer.

image

Contributing

Red Apps can contribute a Nudge widget via ExtensionPointService. Here is a list of all required imports for this step:

import {ExtensionPointService} from 'sabre-ngv-xp/services/ExtensionPointService';
import {NudgeConfig} from 'sabre-ngv-xp/configs/NudgeConfig';

Red Apps can contribute under nudge key as follows:

getService(ExtensionPointService).addConfig('nudge', new NudgeConfig(
    icon,
    text,
    actions,
    filter
));

Config Properties

The following properties can be defined for config:

Property Description

icon

An icon for this widget, it can be 'info', 'warning', 'danger' or custom png icon encoded in BASE64.

text

Text to be displayed in the widget.

actions

An array of INudgeAction, each of them describes a button that will be visible in the widget.

filter

A filter function to determine where this widget should be displayed, based on data availiable in the currently displayed response drawer. An array of NgvNudgeEntry will be passed to this function. Should return a boolean.

Entry Properties

NgvNudgeEntry represents one segment displayed in the response drawer. The following properties are defined for Nudge entry:

Property Description

location

Indicates which of the response drawers that supports Nudge contributions is currently displayed. Possible values: 'AIR_AVAILABILITY', 'SHOPPING', 'HOTEL', 'CAR', 'SELL', 'PRICING'.

origin (optional)

Defines starting point in encoded domain. Domain will depend on the response drawer.

destination

Defines end point in encoded domain. Domain will depend on the response drawer.

start

Defines start date in yyyy-MM-dd’T’HH:mm:ss format.

end

Defines end date in yyyy-MM-dd’T’HH:mm:ss format.

Button Properties

INudgeAction represents a button that can be displayed in the Nudge widget. The following properties can be defined for button:

Property Description

id

Id of this action. It will be used as key attribute for the button tied to this action.

label

Label for a button tied to this action.

action

Function to be called when the button is pressed. An array of NgvNudgeEntry will be passed as a parameter to this function.

TypeScript API

Detailed information about the NudgeConfig, NgvNudgeEntry and INudgeAction is available in TypeScript API Documentation of sabre-ngv-xp module.

Example

com.sabre.redapp.example3.web.nudge SDK sample project contains examples on how to use the Nudge widget.