Data objects
This topic lists the various object definitions included in Sitecore Discover JavaScript SDK for React.
Context
This object describes the widget, page, user, and many other attributes.
Extract the context object from the SDK, with the following method:
import { PageController } from '@sitecore-discover/react';
const context = PageController.getContext();
ProductEventModel
This object describes a product.
Property |
Type |
Description |
---|---|---|
|
string |
Required. The stock keeping unit (SKU) of the product. |
|
number |
Optional. Number of units of the product. |
|
number |
Optional. Price used to calculate the order. |
|
number |
Optional. The originally posted price of the product. |
UserEventModel
This object describes a user.
Property |
Type |
Description |
---|---|---|
|
string |
Required. The email address of the user. |
|
string |
Required. ID of the user. |
|
string |
Optional. ID for the email address of the user. |
CheckoutEventModel
This object describes the checkout event.
Property |
Type |
Description |
---|---|---|
|
string |
Required. ID of the order. |
|
number |
Required. Order total. |
|
number |
Optional. Subtotal of the order. |
ContextUser
The ContextUser
object contains information about the user.
Property |
Type |
Description |
---|---|---|
|
array of strings |
List of IDs of the groups the user belongs to. |
|
array of strings |
List of IDs of orders. |
removePageProductGroup
The method removes the page product group.
Returns: IContext
Argument |
Type |
Description |
---|---|---|
|
string |
Required. This object describes the page. |
|
function |
Accepts any function in the following format: |