{"ref":"capability:plugin-authoring","page":"/capabilities/plugin-authoring","json":"/capabilities/plugin-authoring.json","generated":"2026-10-26","drafted_with_ai":true,"entity":{"id":"plugin-authoring","name":"Plugin authoring","domain":"developer-experience","ecosystems":["cap"],"universal":false,"description":"Writing a package that extends a framework or runtime rather than an application that uses it — a reusable extension loaded by its host, and the question you arrive at once solving a problem twice makes you want to solve it once for everyone.","short":"Writing a package that extends a framework or runtime","core_coverage":{"state":"core-only","assessed_at":"2026-09-27","what_core_does":"The core owns the extension point and makes it almost free to use: a cds-plugin.js file beside a package.json is detected and loaded automatically when a CAP Node.js server bootstraps, the package's own cds entry is merged into cds.env, and cds.plugins exposes the loader for custom servers. A package can be a plugin with an empty tag file and nothing else. On the design-time side, a plugin registers a build plugin with cds.build in the same cds-plugin.js, run by `cds build` to write its own deployment artifacts, and since @sap/cds-dk 7.6.0 may contribute its build task type to the schema. A cds add plugin registers with cds.add in the same file and writes project configuration; in CAP Java a plugin is a Maven artifact that shares CDS models and registers event handlers for custom types and annotations.","where_it_stops":"It stops at loading. What a plugin may safely do once loaded — which lifecycle events to attach to, how to avoid colliding with another plugin's handlers, how to version against a runtime that moves — is convention rather than contract, and is learned from reading other plugins. The design-time half of a plugin, cds add and cds build, is @sap/cds-dk, a dependency that runs locally or in a pipeline and must not be loaded at application runtime.","sources":[{"url":"https://cap.cloud.sap/docs/node.js/cds-plugins","title":"CDS Plugin Packages — capire","checked":"2026-09-08","quote":"Simply add a file cds-plugin.js next to the package.json of your package to have this detected and loaded automatically when bootstrapping CAP Node.js servers."},{"url":"https://cap.cloud.sap/docs/tools/apis/cds-build","title":"Implement Build Plugins — capire","checked":"2026-09-27","quote":"Build plugins are run by cds build to generate the required deployment artifacts. Build tasks hold the actual project specific configuration."},{"url":"https://cap.cloud.sap/docs/tools/apis/cds-build","title":"Implement Build Plugins — capire","checked":"2026-09-27","quote":"A build plugin is a Node.js module complying to the CDS plugin architecture. It must be registered to the CDS build system inside a top-level cds-plugin.js file"},{"url":"https://cap.cloud.sap/docs/tools/apis/cds-build","title":"Implement Build Plugins — capire","checked":"2026-09-27","quote":"In addition you can also add a new build task type provided by your plugin."},{"url":"https://cap.cloud.sap/docs/java/building-plugins","title":"Building Plugins (CAP Java) — capire","checked":"2026-09-27","quote":"A collection of different mechanisms that can be used to build plugins for CAP Java."},{"url":"https://cap.cloud.sap/docs/java/building-plugins","title":"Building Plugins (CAP Java) — capire","checked":"2026-09-27","quote":"In the following sections, the different extension points and mechanisms are explained."},{"url":"https://cap.cloud.sap/docs/tools/apis/cds-add","title":"Plugins for cds add — capire","checked":"2026-09-27","quote":"cds add commands add project configuration to your CAP project."},{"url":"https://cap.cloud.sap/docs/tools/apis/cds-add","title":"Plugins for cds add — capire","checked":"2026-09-27","quote":"CAP provides APIs to create your own cds add plugins."},{"url":"https://cap.cloud.sap/docs/tools/apis/","title":"CDS Design Time APIs — capire","checked":"2026-09-27","quote":"The design-time APIs are provided with package @sap/cds-dk which needs to be installed locally in your project"},{"url":"https://cap.cloud.sap/docs/tools/apis/","title":"CDS Design Time APIs — capire","checked":"2026-09-27","quote":"Note that @sap/cds-dk is a design-time dependency that runs locally or in continuous integration (CI) pipelines. Avoid loading the previously shown code at application runtime in deployed applications."}]},"normative_relevance":[{"instrument":"instrument:sap-developer-license-3-2-cap","prominence":"contextual","sections":["1","2"],"applies_when":"A plugin is developed or distributed for use with SAP CAP materials covered by the agreement.","note":"The agreement expressly includes plug-ins among the SAP materials and section 2 addresses making APIs and tools available to third parties. A plugin's own open-source licence does not erase those separate use terms.","applies_to":{"ecosystems":["cap"]},"sources":[{"url":"https://cap.cloud.sap/resources/license/developer-license-3_2_CAP.txt","title":"SAP Developer License Agreement 3.2 CAP","checked":"2026-09-16","quote":"documentation, plug-ins, templates, scripts and sample code"}]}],"drafted_with_ai":true,"changed_in":[{"version":"@sap/cds-dk 7.5.0","date":"2023-12-18","applies_to":{"ecosystems":["cap"]},"what_changed":"A plugin can implement a build plugin, registered with cds.build in its cds-plugin.js and run by cds build to write its own deployment artifacts; 7.6.0 on 2024-01-31 added contributing the build task type to the cds schema for code completion. Dated from npm.","invalidates":"Advice that deployment artifacts a plugin needs must be produced by a script outside cds build.","source":{"url":"https://cap.cloud.sap/docs/tools/apis/cds-build","title":"Implement Build Plugins — capire","checked":"2026-09-27","quote":"Implement Build Plugins Since @sap/cds-dk 7.5.0"}}],"history":[{"date":"2026-09-27","field":"core_coverage","from":"runtime loading only","to":"runtime loading and the build plugin API","reason":"capire audit 2026-09-27: the Implement Build Plugins page was cited nowhere and carries two version markers."},{"date":"2026-09-27","field":"core_coverage","from":"without the page","to":"cites the page","reason":"capire audit 2026-09-27: the Java Building Plugins page and the cds add plugin API were cited nowhere."},{"date":"2026-09-27","field":"core_coverage","from":"without the page","to":"cites the page","reason":"capire audit 2026-09-27, proposed pages read a fourth time: the paragraph names the cds add and cds build plugin APIs, and the design-time APIs index says which package they are and where they must not run."},{"date":"2026-10-17","field":"description","from":"Writing a package that extends the CAP runtime rather than an application that uses it — the mechanism underneath every cds-plugin in this atlas, and the question you arrive at once solving a problem twice makes you want to solve it once for everyone.","to":"Writing a package that extends a framework or runtime rather than an application that uses it — a reusable extension loaded by its host, and the question you arrive at once solving a problem twice makes you want to solve it once for everyone.","reason":"Keep the default capability wording neutral; preserve the previous wording in framing_by_ecosystem.cap. Maintainer-requested scope audit."}],"framing_by_ecosystem":{"cap":{"description":"Writing a package that extends the CAP runtime rather than an application that uses it — the mechanism underneath every cds-plugin in this atlas, and the question you arrive at once solving a problem twice makes you want to solve it once for everyone."}}},"sap_delivery":{"door":"cap","all":{"built_in":[{"ref":"artifact:cap-java-cds-services-bom","name":"com.sap.cds:cds-services-bom","json":"/artifacts/cap-java-cds-services-bom.json"}],"documented_pattern":[],"announced":[],"packages":[{"ref":"artifact:sap-cds-dk","name":"@sap/cds-dk","json":"/artifacts/sap-cds-dk.json"}]},"by_flavor":{"node":{"built_in":[],"documented_pattern":[],"announced":[],"packages":[{"ref":"artifact:sap-cds-dk","name":"@sap/cds-dk","json":"/artifacts/sap-cds-dk.json"}]},"java":{"built_in":[{"ref":"artifact:cap-java-cds-services-bom","name":"com.sap.cds:cds-services-bom","json":"/artifacts/cap-java-cds-services-bom.json"}],"documented_pattern":[],"announced":[],"packages":[]}}},"edges":{"use_cases":[],"shared_tasks":[],"related_tasks":[],"options":[{"ref":"artifact:sap-cds-dk","name":"@sap/cds-dk","json":"/artifacts/sap-cds-dk.json","ecosystem":"cap","origin_ring":"sap-official"},{"ref":"artifact:cap-java-cds-services-bom","name":"com.sap.cds:cds-services-bom","json":"/artifacts/cap-java-cds-services-bom.json","ecosystem":"cap","origin_ring":"sap-official"}],"samples":[{"ref":"artifact:capire-data-viewer","name":"@capire/data-viewer","json":"/artifacts/capire-data-viewer.json"},{"ref":"artifact:capire-common","name":"common","json":"/artifacts/capire-common.json"},{"ref":"artifact:capire-orders","name":"orders","json":"/artifacts/capire-orders.json"},{"ref":"artifact:capire-orders-java","name":"orders-java","json":"/artifacts/capire-orders-java.json"},{"ref":"artifact:capire-reviews","name":"reviews","json":"/artifacts/capire-reviews.json"},{"ref":"artifact:capire-reviews-java","name":"reviews-java","json":"/artifacts/capire-reviews-java.json"},{"ref":"artifact:sap-samples-cap-tour-hands-on","name":"SAP-samples/cap-tour-hands-on","json":"/artifacts/sap-samples-cap-tour-hands-on.json"},{"ref":"artifact:capire-shared-db","name":"shared-db","json":"/artifacts/capire-shared-db.json"},{"ref":"artifact:capire-shared-db-java","name":"shared-db-java","json":"/artifacts/capire-shared-db-java.json"}],"explained_by":[{"ref":"content:devtoberfest-2026-daniel-hutzel-brain","name":"What's in Daniel Hutzel's brain?","json":"/content/devtoberfest-2026-daniel-hutzel-brain.json"},{"ref":"content:devtoberfest-2026-dry-cap-plugins","name":"DRY CAP – Making Sustainable Solutions Through Plugins","json":"/content/devtoberfest-2026-dry-cap-plugins.json"},{"ref":"content:create-your-first-cap-plugin","name":"Create your first CAP plugin","json":"/content/create-your-first-cap-plugin.json"},{"ref":"content:sap-ai-services-dox-gen-ai-with-sap-cap-plugin-part-3","name":"SAP AI Services - DOX - Gen AI with SAP CAP Plugin - Part 3","json":"/content/sap-ai-services-dox-gen-ai-with-sap-cap-plugin-part-3.json"},{"ref":"content:how-to-build-reusable-plugin-components-for-cap-java-applications","name":"How to build reusable plugin components for CAP Java applications","json":"/content/how-to-build-reusable-plugin-components-for-cap-java-applications.json"},{"ref":"content:btp-cap-custom-plugin-to-separate-generic-change-log-capture-logic","name":"BTP CAP : Custom plugin to separate generic change log capture logic","json":"/content/btp-cap-custom-plugin-to-separate-generic-change-log-capture-logic.json"},{"ref":"content:reusable-components-for-cap-with-cds-plugin","name":"Reusable components for CAP with cds-plugin","json":"/content/reusable-components-for-cap-with-cds-plugin.json"},{"ref":"content:teched-2026-ct1136","name":"AI needs a foundation: A map of the plug-in ecosystem for CAP","json":"/content/teched-2026-ct1136.json"}],"normative_context":[{"ref":"instrument:sap-developer-license-3-2-cap","name":"SAP Developer License Agreement","json":"/instruments/sap-developer-license-3-2-cap.json","prominence":"contextual","sections":["1","2"]}]}}