Hello CAP Community,
We operate a multi-tenant CAP application and have currently implemented the creation of NotificationTypes and the sending of notifications via API calls ourselves. To improve maintainability, promote standardization, and eliminate custom code, we now want to switch to the cap-js/notifications plugin. We have noticed that the plugin requires a destination to the notification endpoint for creating NotificationTypes during deployment. This must be in the provider account. This logic is implemented in the getNotificationDestination method in utils.js. Because the destination is always taken from the provider account, we therefore assume that multitenancy is currently not supported.
Are there any plans to make the plugin usable for multi-tenant CAP applications?
I would like to briefly describe how we handle the sending of notifications in our multi-tenant application: When implementing our own solution, we found that NotificationTypes need to be rolled out per tenant. This raised the question of how to automate the rollout of these types to all tenants during deployment. Technically, this means that you need to read the "SAP_Notification" destination from all tenant subaccounts using a tenant-specific JWT token (which can be passed to the getDestination method from @sap-cloud-sdk/connectivity, but is only available at runtime) and then trigger the endpoint for creating/updating accordingly.
How did we solve this? We do not roll out the NotificationTypes directly during deployment but check in a tenant-specific context before each time a notification is send whether the NotificationType referenced in the notification already exists and respond accordingly.
Thank you in advance for your support!
Hello CAP Community,
We operate a multi-tenant CAP application and have currently implemented the creation of NotificationTypes and the sending of notifications via API calls ourselves. To improve maintainability, promote standardization, and eliminate custom code, we now want to switch to the
cap-js/notificationsplugin. We have noticed that the plugin requires a destination to the notification endpoint for creating NotificationTypes during deployment. This must be in the provider account. This logic is implemented in thegetNotificationDestinationmethod inutils.js. Because the destination is always taken from the provider account, we therefore assume that multitenancy is currently not supported.Are there any plans to make the plugin usable for multi-tenant CAP applications?
I would like to briefly describe how we handle the sending of notifications in our multi-tenant application: When implementing our own solution, we found that NotificationTypes need to be rolled out per tenant. This raised the question of how to automate the rollout of these types to all tenants during deployment. Technically, this means that you need to read the "SAP_Notification" destination from all tenant subaccounts using a tenant-specific JWT token (which can be passed to the
getDestinationmethod from@sap-cloud-sdk/connectivity, but is only available at runtime) and then trigger the endpoint for creating/updating accordingly.How did we solve this? We do not roll out the NotificationTypes directly during deployment but check in a tenant-specific context before each time a notification is send whether the NotificationType referenced in the notification already exists and respond accordingly.
Thank you in advance for your support!