Type alias AppActionRequest<CategoryType, CustomCategoryBody>

AppActionRequest<CategoryType, CustomCategoryBody>: {
    body: CategoryType extends "Custom"
        ? CustomCategoryBody
        : AppActionRequestBody<CategoryType>;
    headers: Record<string, string | number>;
    type: FunctionTypeEnum.AppActionCall;
}

The app action request body will contain different parameters depending on the category of the app action

Specify your app action category as the generic type Category to get the correct body type, e.g. const { body: { message, recipient }} = event as AppActionRequest<'Notification.v1.0'>

If you are using the Custom category, you can specify the parameter shape as the second generic type CustomCategoryBody, e.g. const { body: { myNumber }} = event as AppActionRequest<'Custom', { myNumber: number }>

Type Parameters

  • CategoryType extends AppActionCategoryType = "Custom"
  • CustomCategoryBody = AppActionCategoryBodyMap["Custom"]

Type declaration