CDS pluginCDS plugintypeInstalls into a CAP project and extends the runtime. CAP loads it through cds.requires or the plugin hook.See every one →What this type is →independently maintainedindependently maintainedoriginPublished by one person or a small company outside SAP. Says nothing about quality; the readings say that.See every one →

cds-plugin-handlers

A CAP plugin that structures handlers as one file per entity, in a folder per service, instead of one service implementation that keeps growing.

Facts

Latestv1.0.3ReleasedLast pushLicenceApache-2.0

Where it sits

Lives in
Provides
TypeScript patternsCAPTypeScript patternscapabilityHow an application is arranged once it is written in TypeScript — where handlers live, what registers them, and how business logic is kept apart from persistence. Distinct from typing, which is about the model being visible to the compiler; this is about the shape of the code around it.
Flavors
Node.jsfrom its runtime
Requires
@sap/cds^8.7.2@sap/cdsartifactThe peer range, as published.

Who is behind it

Wouter LemaireWouter LemairePersonMaintains this
In the atlas: maintains 25, contributes to 39, wrote 12
@lemaiwo
maintainerGert MertensPersonContributes to this
In the atlas: contributes to 1
@gertmertens92
1 contributor

Before choosing this

Conditions

LicenceSAP Developer License Agreement 3.2 CAP§ 1, 2, 3A cds-plugin is used with SAP CAP materials, or an artifact is explicitly identified as a CAP plugin or application.
  • § 1 License. Productive customer applications are limited to SAP BTP or another SAP-licensed platform, and mass extraction to a non-SAP product is restricted except where solely required for SAP interoperability.
  • § 2 Intellectual Property. The agreement retains SAP's rights in the covered materials and limits making APIs, tools or software available to third parties, while preserving ownership of customer applications subject to SAP's underlying rights.
  • § 3 Artificial Intelligence Training. The agreement prohibits use of the covered materials and customer applications for training artificial-intelligence models or systems.
SAP Developer License Agreement 3.2 CAP →

What it declares

Every artifact

Type
CDS plugin
Origin
Independently maintained
Runtime
Node.js

As a CDS plugin

Declared for
^8.7.2
Distributed through
npm

For typeScript patterns

How handlers bind
folder layout
Layers it names
handlersexternal services

Tasks this contributes to2Beta

Keep data access out of a CAP service's handlersThe data access of a CAP service written in TypeScript is called through classes with methods rather than written as queries inside the event handlers, so a handler holds the business logic and the queries sit behind one object.Node.jsCoverslayer for other systems
What it does

Answers the outcome for data that is not the project's own entities: a services folder holds a class per external service, and the requests to an external API or another database are written there rather than in the handler.

Remaining work

The project's own entities are not covered by that layer. What the README states is where the external-service classes go; the calls inside them are the application's.

All options on the TypeScript patterns page →
Split one CAP service implementation into a class per entityThe custom logic of a CAP service written in TypeScript sits in one class per entity rather than in a single service implementation file, and each class's methods still reach the framework as the before, on and after handlers for that entity.Node.jsCovershandler classes by folder convention
What it does

Where a class goes is the declaration: a folder per service under src/handlers, and inside it a class per entity named after that entity. As a cds-plugin it loads itself, so the service implementation holds nothing that lists the classes.

Remaining work

The folder and file names carry the binding, so renaming a service or an entity in the model means moving or renaming files. The README read today does not state which method names a handler class uses.

All options on the TypeScript patterns page →

Connections1

Install

npm add cds-plugin-handlers

Derived from the package name. No recipe recorded; the README has the configuration.

Learn more1

Readings
  1. Create your first CAP pluginWouter Lemaire, SAP Community

README

quoted from lemaiwo/cds-plugin-handlers under Apache-2.0, read
lemaiwo/cds-plugin-handlers/readme.mdOn GitHub

CDS-PLUGIN-HANDLERS

CAP CDS Plugin that enables classes for entities in a structured way + implementing an additional layer for service classes to separate the implementation for requests to external api's.

Installation

npm install cds-plugin-handlers

Usage

Create a folder "handlers" in the "src" folder. Inside the "handlers" folder you have to create a folder for each service, e.g.: "CatalogService" for the service CatalogService. In here, you have to create a handler class for each entity, e.g.: "BooksHandler" for the entity Books.

This plugin also allows you to implement separation by concerns when it comes to external services. All requests to external services or even to different databases can be stored in a folder "services". In here, you have to create a service class for each external service to implement all the needed requests.

The folder structure in the "srv" folder should look like this:

srv
├── src
│   └── handlers
|   |        ├── CatalogService
|   |        |        ├── BooksHandler.ts
│   |        |        └── AnyOtherHandlerY.ts
│   |        └── AnyOtherService
│   |                 └── AnyOtherHandlerX.ts
|   └── services
│           ├── BookService.ts
│           └── AnyOtherServiceX.ts
└── cat-service.cds
Documentation

We have documented this approach already before the plugin but the documentation still applies, only the setup changed. Everthing is explained in the following blog posts:

Demo app

Demo app available on GitHub https://github.com/lemaiwo/cds-plugin-handlers/tree/main/sample

Demo project using services: https://github.com/lemaiwo/ReCAPBTPServiceOverview

Apache-2.0, read

History

Latest

v1.0.3

  1. v1.0.2

  2. v1.0.1

  3. v1.0.0

On npm
1downloads per week, npm
Weekly downloads for cds-plugin-handlers26 complete calendar weeks from 2026-04-27 to 2026-10-25; the latest total is 1.27 Apr – 3 May: 74 May – 10 May: 1611 May – 17 May: 1018 May – 24 May: 1225 May – 31 May: 281 Jun – 7 Jun: 238 Jun – 14 Jun: 1215 Jun – 21 Jun: 922 Jun – 28 Jun: 329 Jun – 5 Jul: 136 Jul – 12 Jul: 1313 Jul – 19 Jul: 420 Jul – 26 Jul: 527 Jul – 2 Aug: 33 Aug – 9 Aug: 710 Aug – 16 Aug: 1017 Aug – 23 Aug: 324 Aug – 30 Aug: 931 Aug – 6 Sept: 87 Sept – 13 Sept: 514 Sept – 20 Sept: 821 Sept – 27 Sept: 1228 Sept – 4 Oct: 75 Oct – 11 Oct: 812 Oct – 18 Oct: 119 Oct – 25 Oct: 1
TypeScript patterns
  1. @dxfrontier/cds-ts-dispatcherDecorator-driven handler registration for CAP in TypeScriptfrom CAP
  2. @dxfrontier/cds-ts-repositoryTyped BaseRepository over CAP entitiesfrom CAP
  3. cds-routing-handlersDecorator-based routing of CAP service handlers in TypeScriptfrom CAP
  4. cds2typesCLI generating TypeScript interfaces from a CDS modelfrom CAP
  5. cap-handler-frameworkConvention-based handler layer for CAP with draft lifecycle hooksfrom CAP
  6. cds-plugin-typescriptCDS build task compiling TypeScript sources during cds buildfrom CAP
  7. cds-hyper-app-serviceTyped class-based service layer over CAP ApplicationServicefrom CAP

Details

Sources4
GitHub APIdiscovered here, lemaiwochecked
npm registry, cds-plugin-handlersversion, releases, installschecked
github.com/git+https://github.com/lemaiwo/cds-plugin-handlers.gittree, pushes, contributors, CIchecked
readme.mdquoted, and what the entry declareschecked

Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.

Compatibility and provenance
runtimesnode
declared for^8.7.2
latestv1.0.3
first release
releases and cadence4, ~106d median
discovered viaGitHub API · lemaiwo
first seen in the atlas
ecosystem and domaincap, developer-experience
Contributors1

From the repository’s contributor list, .

History in the atlas2
  1. what_it_does and two facet values
  2. First seen.
For your agent
Ref
artifact:lemaiwo-cds-plugin-handlers
JSON
/artifacts/lemaiwo-cds-plugin-handlers.json
MCP
Connecting an agent