GetActions
Description
- The getActions method retrieves experience-based actions from the personalization engine using the data provided in the Context.
- It supports both single-context and multi-context evaluations, depending on the data configured in the Context.
Method Signature
async getActions(
actionType: string | string[],
context?: any,
includeReporting: boolean = true,
errorCallback?: (result: { status: "success" | "failed"; error?: unknown }) => void
): Promise<{ data: unknown; errors?: unknown }> {}
Description
Retrieves experience-based actions from the personalization engine using the data provided in the Context object.
Parameters (Short)
Parameter | Description |
|---|---|
context | Contains all context and event data required for evaluation |
arrActionTypes | A list of action types to be retrieved. Supports both single and multiple action types. |
includeReporting | Determines whether reporting data should be returned in the response. Use true to include reporting data; use false otherwise. |
Future | Returns actions data or error |
Example :-
Personalization.getActions(
["monetate:action:OmnichannelJson"],
monetateContext)
.then((res: any) => console.log("Action === 1 res", res))
.catch((err:any) => console.log("Error ===", err)) ;