CAP Plugins & Enhancements
Following is a curated list of plugins that are available for the SAP Cloud Application Programming Model (CAP) which provide integration with BTP services and technologies, or other SAP products.
Maintained by CAP and SAP
These plugins are created and maintained in close collaboration and shared ownership of CAP development teams and other SAP and BTP development teams.
As cds-plugins for Node.js
For Node.js all these plugins are implemented using the cds-plugin
technique, which features minimalistic setup and plug & play experience. Usually usage is as simple as that, like for the Audit Logging plugin:
Add the plugin:
shnpm add @cap-js/audit-logging
npm add @cap-js/audit-logging
Add annotations to your models:
cdsannotate Customer with @PersonalData ...;
annotate Customer with @PersonalData ...;
Test-drive locally:
shcds watch
cds watch
→ audit logs are written to console in dev mode.
Bind the platform service.
→ audit logs are written to Audit Log service in production.
GraphQL Adapter
The GraphQL Adapter is a protocol adapter that generically generates a GraphQL schema for the models of an application and serves an endpoint that allows you to query your services using the GraphQL query language. All you need to do is to add the @graphql
annotation to your service definitions like so:
@graphql service MyService { ... }
@graphql service MyService { ... }
Available for:
OData v2 Proxy
@cap-js-community/odata-v2-adapter
The OData v2 Proxy is a protocol adapter that allows you to expose your services as OData v2 services. For Node.js, this is provided through the @cap-js-community/odata-v2-adapter plugin, which converts incoming OData V2 requests to CDS OData V4 service calls and responses back. For Java, this is built in.
Available for:
Click on the icons to get detailed instructions.
See also Advanced →> OData APIs → V2 Support
UI5 Dev Server
The UI5 Dev Server is a CDS server plugin that enables the integration of UI5 (UI5 freestyle or Fiori elements) tooling-based projects into the CDS server via the UI5 tooling express middlewares. It allows to serve dynamic UI5 resources, including TypeScript implementations for UI5 controls, which get transpiled to JavaScript by the plugin automatically.
Available for:
Click on the icon to get detailed instructions.
Change Tracking
The Change Tracking plugin provides out-of-the box support for automated capturing, storing, and viewing of the change records of modeled entities. All we need is to add @changelog annotations to your models to indicate which entities and elements should be change-tracked.
annotate my.Incidents {
customer @changelog: [customer.name];
title @changelog;
status @changelog;
}
annotate my.Incidents {
customer @changelog: [customer.name];
title @changelog;
status @changelog;
}
Available for:
Click on the icon to get detailed instructions.
Audit Logging
The new Audit Log plugin provides out-of-the box support for logging personal data-related operations with the SAP Audit Log Service. All we need is annotations of respective entities and fields like that:
annotate my.Customers with @PersonalData {
ID @PersonalData.FieldSemantics: 'DataSubjectID';
name @PersonalData.IsPotentiallyPersonal;
email @PersonalData.IsPotentiallyPersonal;
creditCardNo @PersonalData.IsPotentiallySensitive;
}
annotate my.Customers with @PersonalData {
ID @PersonalData.FieldSemantics: 'DataSubjectID';
name @PersonalData.IsPotentiallyPersonal;
email @PersonalData.IsPotentiallyPersonal;
creditCardNo @PersonalData.IsPotentiallySensitive;
}
Features:
- Simple, Annotation-based usage → automatically logging personal data-related events
- CAP Services-based programmatic client API → simple, backend-agnostic
- Logging to console in development → fast turnarounds, minimized costs
- Logging to SAP Audit Log Service in production
- Transactional Outbox → maximised scalability and resilience
Available for:
Click on the icons to get detailed instructions.
Notifications
The Notifications plugin provides integration with the SAP Alert Notifications service to send notifications via email, Slack, Microsoft Teams, or SAP Fiori notifications. The client is implemented as a CAP service, which gives us a very simple programmatic API:
let alert = await cds.connect.to ('notifications')
await alert.notify({
recipients: [ ...supporters ],
title: `New incident created by ${customer.info}`,
description: incident.title
})
let alert = await cds.connect.to ('notifications')
await alert.notify({
recipients: [ ...supporters ],
title: `New incident created by ${customer.info}`,
description: incident.title
})
Features:
- CAP Services-based programmatic client API → simple, backend-agnostic
- Logging to console in development → fast turnarounds, minimized costs
- Sending to SAP Alert Notification Service in production
- Transactional Outbox → maximised scalability and resilience
- Notification templates with i18n support
- Automatic lifecycle management of notification templates
- SAP ANS supports email, Slack, Microsoft Teams, and SAP Fiori notifications
Available for:
Click on the icon to get detailed instructions.