Skip to content

Client Selectors

Retrieves the device information from the client information in the store.

import { getDeviceInformation } from '@shopgate/engage/core';

Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7: import { getDeviceInformation } from '@shopgate/pwa-common/selectors/client'

  • state (Object) required: The application state.

(Object|null): The device information. If no device information is found, it returns null.

The following device information was taken from a Samsung Galaxy S8 with Android 8. The data is usually provided by the native part of Engage. Within the browser environment you will receive a reduced version of the object with mocked data which is based on the User Agent.

{
advertisingId: '0c882fb3-3254-445d-b662-e0e61cf83976',
cameras: [
{
light: true,
resolutionX: 4032,
resolutionY: 3024,
type: 'back',
video: true
},
{
light: false,
resolutionX: 3264,
resolutionY: 2448,
type: 'front',
video: true
}
],
carrier: 'T-Mobile',
locale: 'en',
model: 'SM-G950F',
os: {
apiLevel: '26',
platform: 'android',
ver: '8.0.0'
},
screen: {
height: 2768,
scale: 4,
width: 1440
},
type: 'phone'
}

Retrieves the platform for the device from the client information in the store.

import { getPlatform } from '@shopgate/engage/core';

Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7: import { getPlatform } from '@shopgate/pwa-common/selectors/client'

  • state (Object) required: The application state.

(string|null): The platform information. Possible values ios and android. If no platform information is found, it returns null.


Retrieves the operating system version from the client information in the store.

import { getOSVersion } from '@shopgate/engage/core';

Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7: import { getOSVersion } from '@shopgate/pwa-common/selectors/client'

(string|null): The OS version. The format depends on the device and OS (e.g. “12.3” or “8.0.0”). If no OS version is found, it returns null.


Retrieves the device model from the client information in the store.

import { getDeviceModel } from '@shopgate/engage/core';

Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7: import { getDeviceModel } from '@shopgate/pwa-common/selectors/client'

  • state (Object) required: The application state.

(string|null): The device model (e.g. “SM-G950F” or “iPhone11.0”). If no device model information is found, it returns null.


Retrieves whether the platform is “Android” from the client information in the store.

import { isAndroid } from '@shopgate/engage/core';

Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7: import { isAndroid } from '@shopgate/pwa-common/selectors/client'

  • state (Object) required: The application state.

(boolean): Whether the platform is Android.


Retrieves whether the platform is iOS from the client information in the store.

import { isIos } from '@shopgate/engage/core';

Attention: The path to the old modules is deprecated and will be removed in ENGAGE v7: import { isIos } from '@shopgate/pwa-common/selectors/client'

  • state (Object)required: The application state

(boolean): Whether the platform is iOS.