Overview
Quick Start
For a quick start check out the "Getting Started" page.
What is the SAP Cloud SDK for JavaScript?
The SAP Cloud SDK for JavaScript is a set of libraries that reduces the effort of building applications on the SAP Business Technology Platform (SAP BTP). It abstracts common tasks on SAP BTP so that you can concentrate on your business logic instead of writing boiler plate code. The image below shows the general architecture of an application built with the SAP Cloud SDK.
The SAP Cloud SDK consists of two major parts:
- the core libraries
- the pregenerated client libraries
The Core Libraries
The core libraries are the heart of the SAP Cloud SDK for JavaScript.
Those libraries contain the request execution and connectivity logic as well as command line interfaces (CLIs) to generate OData and OpenApi clients.
The image below shows the relationship between the individual core libraries.
All core libraries are available as open source npm packages in the @sap-cloud-sdk
scope on npm.
@sap-cloud-sdk/connectivity
The connectivity library provides functionality to read and exchange with services like the destination, XSUAA, and connectivity service. It provides the basic types needed to reflect the concept of a destination throughout the SAP Cloud SDK for JavaScript.
@sap-cloud-sdk/http-client
The HTTP client library is a thin HTTP client, that allows you to execute requests by leveraging the concept of destinations. You can flexibly configure a request to your needs and send arbitrary HTTP requests to the given destination.
@sap-cloud-sdk/odata-v2
, @sap-cloud-sdk/odata-v4
, and @sap-cloud-sdk/openapi
The OData v2, v4, and OpenAPI libraries build the foundation for client libraries (custom and pregenerated). They contain OData and OpenAPI-specific abstractions, that the client libraries use to expose their APIs.
@sap-cloud-sdk/generator
and @sap-cloud-sdk/openapi-generator
The OData and OpenAPI generators are CLIs that generate client libraries based on the services' specifications (either EDMX format or OpenAPI/Swagger). You can use them to generate your clients. The pregenerated client libraries are generated using these generators.
Pregenerated Client Libraries
While you can generate your libraries, the SAP Cloud SDK for JavaScript provides pregenerated client libraries for the SAP S/4HANA Cloud and On-Premise APIs as well as the SAP Workflow service. These libraries are published under the SAP Developer license agreement and are free to use.
Feature Matrix
Legend: ✔️ - Generally Available, ❌ - Not Available, ⚙ - Beta, 📅 - Planned
Feature | SAP Cloud SDK JavaScript | |||
---|---|---|---|---|
Category | Name | Status | Docs | Notes |
Legacy | ❌ | Take a look at the node-soap library | ||
Legacy | ❌ | Take a look at the SAP NetWeaver RFC SDK client bindings for Node.js | ||
Legacy | ❌ | Take a look at the SAP NetWeaver RFC SDK client bindings for Node.js | ||
OData | ✔️ | |||
OData | ✔️ | |||
OData | Generic not typed OData client | ❌ | We expose generic HTTP client aware of connectivity abstractions | |
OData | ✔️ | |||
OpenAPI | OpenAPI 2.0 typed client | ✔️ | ||
OpenAPI | OpenAPI 3.0 typed client | ✔️ | ||
OpenAPI | OpenAPI code generator | ✔️ | ||
Messaging | Enterprise messaging | 📅 | Planned. Depends on CAP | |
Advanced | Resilience pattern | ❌ | ||
Advanced | Caching pattern | ❌ | ||
Environment | ✔️ | |||
Environment | ✔️ | |||
Environment | ✔️ | |||
Environment | Deploy with Confidence (DwC) | ❌ | ||
Environment | ❌ | Not recommended for new projects | ||
Environment | ❌ | Out of scope | ||
Connectivity | ✔️ | |||
Connectivity | ✔️ | |||
Connectivity | ✔️ | |||
Connectivity | ✔️ | |||
Connectivity | Authentication | ✔️ | ||
Connectivity | Multi-tenancy | ✔️ | ||
Connectivity | Proxy | ✔️ | ||
Connectivity | HTTP Client wrapper | ✔️ | ||
Connectivity | ✔️ | |||
Connectivity | ✔️ | |||
MDI | MDI | ❌ |
Comparison with SAP OData Library
There is also a second open-source library for consuming OData services developed by SAP. The SAP OData library is developed by a different team than the SAP Cloud SDK. It evaluates service specifications at runtime and helps you execute requests. The table below tries to draw a line between the two open source libraries:
OData library | SAP Cloud SDK |
---|---|
Supports JavaScript. | Supports JavaScript and TypeScript. |
Operates dynamically on the metadata and creates an on-the-fly-client. | Uses pregenerated clients at runtime. For many standard systems like SAP S/4HANA, clients are available via npm or can be generated with the generator. |
Connectivity needs to be handled manually. | The SAP Cloud SDK handles connectivity on the SAP BTP for you. |