Skip to main content

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.

General architectureGeneral architecture

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.

Core packagesCore packages

@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

FeatureSAP Cloud SDK JavaScript
CategoryNameStatusDocsNotes

Legacy

SOAP

Take a look at the node-soap library

Legacy

BAPI

Take a look at the SAP NetWeaver RFC SDK client bindings for Node.js

Legacy

RFC

Take a look at the SAP NetWeaver RFC SDK client bindings for Node.js

OData

OData v2 typed client

✔️

docs

OData

OData v4 typed client

✔️

docs

OData

Generic not typed OData client

We expose generic HTTP client aware of connectivity abstractions

OData

OData code generator

✔️

docs

OpenAPI

OpenAPI 2.0 typed client

✔️

docs

OpenAPI

OpenAPI 3.0 typed client

✔️

docs

OpenAPI

OpenAPI code generator

✔️

docs

Messaging

Enterprise messaging

📅

Planned. Depends on CAP

Advanced

Resilience pattern

Request this feature

Advanced

Caching pattern

Request this feature

Environment

BTP Cloud Foundry Environment

✔️

docs

Environment

Kubernetes with SAP Gardener

✔️

docs

Environment

BTP Kyma Environment

✔️

docs

Environment

Deploy with Confidence (DwC)

Request this feature

Environment

BTP Neo Environment

Not recommended for new projects

Environment

SAP BTP ABAP Environent

Out of scope

Connectivity

BTP CF Connectivity Service

✔️

docs

Connectivity

BTP CF Destination Service

✔️

docs

Connectivity

BTP CF XSUAA Service

✔️

docs

Connectivity

BTP CF Service Bindings

✔️

Connectivity

Authentication

✔️

docs

Connectivity

Multi-tenancy

✔️

docs

Connectivity

Proxy

✔️

docs

Connectivity

HTTP Client wrapper

✔️

docs

Connectivity

Principal propagation

✔️

docs

Connectivity

Cloud Connector

✔️

docs

MDI

MDI

Request this feature

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 librarySAP 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.