Overview
This extension enables adding external services from the service catalog into CAP Node.js projects.
How to Use
Prerequisite
Ensure the CDS Command Line Interface (CDS CLI) is installed.
Installation instructions: https://cap.cloud.sap/docs/get-started/#installation
Procedure
You can select a service from the Service Catalog extension and add it as an external service to a CAP Node.js project:
- Make sure you have a CAP Node.js project open in your Visual Studio Code workspace.
- From the Service Catalog extension, browse and select a service.
- Click Add to CAP project. If multiple projects are open, select the relevant one.
Results
After adding the service, the following changes occur in your CAP Node.js project:
- The external service is now available within your CAP Node.js project.
- <service_name>.xmland- <service_name>.cdsfiles are created under the- srv/externalfolder.
- The package.jsonservices section is updated to reference the new service, for example:
  "<service_name>": {
    "kind": "odata-v2",
    "model": "srv/external/<service_name>",
    "[production]": {
      "credentials": {
        "destination": "<system_name>",
        "path": "/<path_to_service>"
      }
    },
    "csrf": true,
    "csrfInBatch": true
  }
- The package.jsonscripts section is updated to include the live profile:
"start-live": "cds watch --profile live"
- A .cdsrc-private.jsonfile is generated, containing a live profile that enables app preview with live data:
{
  "requires": {
    "<service_name>": {
      "[live]": {
        "credentials": {
          "url": "https://<your_URL>",
          "username": "<your_username>",
          "password": "<YOUR_PASSWORD_HERE>",
          "isTrustingAllCertificates": true
        },
        "csrf": true,
        "csrfInBatch": true
      }
    }
  }
}
Replace all placeholders with your actual values.
Support
Join the SAP community to ask questions, read the latest blogs, and explore additional resources related to SAP services.
License
SAP DEVELOPER LICENSE AGREEMENT
Open Source Software and Licensing Document
You can view the Open Source License Notification for this extension.