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 →

cap-user-info

Resolves the createdBy and modifiedBy of a managed entity to a stored user record of email, given name and family name, and renders the two fields as links with a quickview.

cap-user-info adds a UserTracked aspect that extends CAP's managed, a UserInfo entity holding Email, GivenName and FamilyName, and the associations _toCreatedUserInfo and _toModifiedUserInfo that resolve through createdBy and modifiedBy, so including the aspect is enough and no separate managed declaration is needed. It registers after-CREATE and after-UPDATE handlers on every application-service entity carrying the aspect and upserts the current user, req.user, into UserInfo, which is what fills the record. The same association can be pointed at any other user field on an entity, and UserInfo itself can be extended with further elements such as a Department, as long as the handler that populates them is registered in the root context rather than inside srv.init. Labels ship as English properties in _i18n and are overridden per locale from the app's own i18n folder.

Facts

Latestv0.1.9ReleasedLast pushLicenceMIT

Where it sits

Lives in
Provides
Data modellingCAPData modellingcapabilityDefining the shape of data before anything serves it: entities and their types, how they relate, and the projections and views that services and applications consume.Fiori annotationsCAPFiori annotationscapabilityDescribing a service so a Fiori client can render it without hand-written UI code — titles, value helps, hierarchies and visibility expressed as model annotations rather than screen logic.
Flavors
Node.jsfrom its runtime
Requires
@sap/cds≥ 8@sap/cdsartifactThe peer range, as published.

Who is behind it

Jakob Marius KjaerJakob Marius KjaerPersonMaintains this
In the atlas: maintains 2, contributes to 24, wrote 1
@uxkjaer
maintainer

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
Distributed through
npm

Connections2

Install

npm add cap-user-info

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

README

quoted from uxkjaer/cap-user-info under MIT, read
uxkjaer/cap-user-info/README.mdOn GitHub

cap-user-info

CDS plugin that adds user details on managed entities.

Install

npm install cap-user-info

Usage

The userinfo has the following properties by default that is added to the database

entity UserInfo {
        @UI.Hidden
    key ID         : UUID;

        @assert.unique: true  @title: 'Email Address'
        @Communication: {IsEmailAddress: true}
        Email      : String;

        GivenName  : String @title: 'Given Name';
        FamilyName : String @title: 'Family Name';
        FullName   : String = concat(
            GivenName, ' ', FamilyName
        );
}

Import it into your cds file.

using { UserTracked, UserInfo } from 'cap-user-info';

entity MyEntity : cuid, UserTracked {
  // your fields
}

The plugin auto-registers .after("CREATE" | "UPDATE") handlers on every application-service entity that includes the UserTracked aspect. Each handler UPSERTs the current user (req.user) into UserInfo. The associations _toCreatedUserInfo / _toModifiedUserInfo resolve via createdBy / modifiedBy.

The fields for createdBy and modifiedBy will automatically be shown as links with a quickview with the user details. alt text

How it works

UserTracked extends managed, so consuming entities automatically inherit createdBy / modifiedBy (and the corresponding timestamps):

It will add a quickview to the createdBy and modifiedBy to show the user details. The details are stored from the req.user upon changes to the entity. alt text

aspect UserTracked : managed { ... }

This means no extra managed declaration is required on the consuming entity — including UserTracked is enough.

Using the plugin for other purposes

Add a field to your entity and a association


using { UserTracked, UserInfo } from 'cap-user-info';

entity MyEntity : cuid, UserTracked {
  // The cds.on.insert is only to insert the userid automatically, otherwise handle it via code.
  Responsible: User @cds.on.insert: $user.id;,
  _toResponsibleUser: association to one UserInfo on _toResponsibleUser.ID = $self.Responsible
}

Then the quickview will automatically be active alt text

Extending the quickview

You can extend the UserInfo to add more data into the quickview by adding to the fieldgroup in a cds file.

  // Change the quickview
extend cap.userinfo.UserInfo with
  @UI.FieldGroup: {Data: [
    // Leave the original properties
    {
      $Type: 'UI.DataField',
      Value: GivenName
    },
    {
      $Type: 'UI.DataField',
      Value: FamilyName
    },
    {
      $Type: 'UI.DataField',
      Value: Email
    },
    // your new field
    {
      $Type: 'UI.DataField',
      Value: Department
    }, 
  ]}

  //Change the 
  @UI.HeaderInfo     : {
    ImageUrl    : '',
    TypeImageUrl: 'sap-icon://employee',
    Title       : {
        Value: FullName,
    },
    TypeName    : '',
}
  {
    // your new field iin the entity
    Department : String @title                        : 'Department';
  }

Then register your event handler to populate the data. It's important this piece of code isn't added within your srv.init method. It needs to be in the root context.

cds.on("served", () => {
  const { db } = cds.services;
  const { UserInfo } = cds.entities("cap.userinfo");

  //Register the handler for the Upsert
  db.before("UPSERT", UserInfo, async (req) => {
    //Change the data
    req.data.Department = "Admin";
  });
});
MIT, read

History

Latest

v0.1.9

  1. v0.1.8

  2. v0.1.7

  3. v0.1.6

  4. v0.1.5

  5. v0.1.4

  6. v0.1.2

  7. v0.1.1

  8. v0.1.0

On npm
7downloads per week, npm
Weekly downloads for cap-user-info26 complete calendar weeks from 2026-04-20 to 2026-10-18; the latest total is 7.20 Apr – 26 Apr: 027 Apr – 3 May: 04 May – 10 May: 011 May – 17 May: 018 May – 24 May: 025 May – 31 May: 01 Jun – 7 Jun: 08 Jun – 14 Jun: 015 Jun – 21 Jun: 022 Jun – 28 Jun: 38629 Jun – 5 Jul: 6276 Jul – 12 Jul: 8113 Jul – 19 Jul: 3320 Jul – 26 Jul: 8427 Jul – 2 Aug: 1983 Aug – 9 Aug: 5510 Aug – 16 Aug: 5917 Aug – 23 Aug: 5024 Aug – 30 Aug: 4131 Aug – 6 Sept: 287 Sept – 13 Sept: 2914 Sept – 20 Sept: 3521 Sept – 27 Sept: 5228 Sept – 4 Oct: 555 Oct – 11 Oct: 1612 Oct – 18 Oct: 7

Others providing16

Data modelling
  1. cds-numberrange-pluginFills a CDS element from a database-backed number range
  2. com.sap.cds:cds-services-bomMaven bill of materials pinning CAP Java module versions
  3. @sap/cds-common-contentISO content for CAP's countries, languages, currencies and timezones
  4. @sap/cds-compilerCompiler from CDS models to CSN, EDMX and database schemas
  5. @sap/cdsCAP Node.js runtime
Fiori annotations
  1. com.sap.cds:cds-services-bomMaven bill of materials pinning CAP Java module versions
  2. urp-vocabCDS vocabulary for User-Rendered Patterns display annotations
  3. @mpah/enum-value-helpCAP plugin generating value help for enum fields from an annotation
  4. @sap/cds-fioriFiori draft handling and UI-facing behaviour for CAP services
  5. @sap/cdsCAP Node.js runtime
  6. @sap/generator-fioriEntry point for generating a Fiori application from a template
  7. @sap-ux/cds-annotation-parserParser for annotations in CDS source
  8. @sap/ux-cds-compiler-facadeWrapper around the CDS compiler for annotation handling
  9. @sap-ux/cds-odata-annotation-converterConverter from CDS annotations to their OData form
  10. @sap/ux-cds-odata-language-server-extensionOData annotation features for the @sap/vscode-cds extension
  11. @sap-ux/fiori-annotation-apiProgrammatic API for reading and writing project annotations
  12. @sap-ux/odata-vocabulariesOASIS and SAP OData vocabularies with a VocabularyService
  13. cap-js-geoloc-pluginAnnotation-driven geocoding, address correction and routing for CAP

Details

Sources5
npm registrydiscovered here, npm:cds-pluginchecked
npm registrydiscovered here, npm:cds-checked
npm registry, cap-user-infoversion, releases, installschecked
github.com/git+https://github.com/uxkjaer/cap-user-info.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
latestv0.1.9
first release
releases and cadence9, ~1d median
discovered vianpm registry · npm:cds-plugin, npm registry · npm:cds-
first seen in the atlas
ecosystem and domaincap, data-and-persistence
History in the atlas1
  1. First seen.
For your agent
Ref
artifact:uxkjaer-cap-user-info
JSON
/artifacts/uxkjaer-cap-user-info.json
MCP
Connecting an agent