Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 


SAP Cloud SDK for JavaScript version 3 is released! 🎉

This is a major release which brings new features and improves the APIs considerably.

Get the new version on npmjs.com.

Find out all about the improvements in the new version in this blog post, and find out who makes the most commits to the SAP Cloud SDK for JavaScript repository.

What's new?


Middlewares


Middlewares are a powerful and flexible concept which allows to add custom logic before HTTP requests are sent - similar to well known web frameworks such as Express or NestJS. For example they allow you to add custom headers to HTTP requests or make changes to the request body.
You can also use it to build the resilience features just the way you need them for your application, in case the defaults don't work for you.

To find out more about how you can use middlewares, see the middleware documentation.

Resilience


Resilience is the ability of your app to react to failure and still be functional. The goal is not to avoid failure at all cost, but rather to handle it gracefully and still provide a good experience to users.
The SAP Cloud SDK for JavaScript has default configuration for resilience features such as circuit breakers, retries and timeouts built-in, you just need to enable it.
If you need to build more complex features, we have you set with the middlewares: just build your own.

To find out more about resilience and how you can build your own configuration, see the blog post on Resilience and the resilience documentation.

You can also watch this SAP Community Call on resilience to get some hands-on impressions.

Sending E-Mails


Sending E-mails via SAP Business Technology Platform was already possible in version 2, but the API was still "experimental". In version 3 the feature is fully supported and has the same stability as other features of the SAP Cloud SDK for JavaScript.

To find out more about how to send e-mails, see the documentation on the mail client.

What's changed?


Improved and streamlined OData and OpenAPI Generators


The SAP Cloud SDK's generators for typed clients for OData and OpenAPI APIs are improved and streamlined. Over time the options of both generates had diverged. In version 3, the options are better aligned so that the same option in both generators has the same name and behavior.
To do this, some breaking changes were required and usage needs to be adapted when upgrading the SAP Cloud SDK for JavaScript from version 2 to version 3.

Pregenerated clients discontinued


We noticed, that many users preferred to use custom generated clients instead of the pregenerated ones. Therefore, we decided to stop publishing pregenerated clients for SAP services on NPM. From now on, use the improved client generators for OData and OpenAPI to generate your own.
You can find all specifications for SAP services on the SAP API Business Hub. Follow the SAP Cloud SDK tab on the API detail pages for instructions.

Node.js runtime requirements


Since older versions of Node.js will reach end of life in 2023, the SAP Cloud SDK for JavaScript will require Node.js 18 (the current LTS version) as a runtime starting with version 3.
Node.js 18 is available on SAP Business Technology Platform, Cloud Foundry Environment. See the this page in the SAP Help portal for details on how to use it.

How to upgrade?


Apart from the changes and above, we've also removed a few deprecated functions and simplified some types in the SAP Cloud SDK. Since the API improvements and simplifications required some breaking changes, upgrading to version 3 might require some changes to your application.

See the full upgrade guide and let us know if you have issues while upgrading or if something is not covered in the guide.

Your feedback matters


Besides all the work on the code and documentation of the SAP Cloud SDK, we've also improved how we do user research in the last year.

We want to understand our users better


We had a first round of user interviews with colleagues at SAP, but we're also planning to expand this to our global community. We don't have the details figured out just yet, but if you'd like to volunteer for a one hour interview later this year feel free to reach out in the comments, or in the GitHub Discussion.

Version 3 feedback thread


Let us know what you think about version 3 in this GitHub Discussion.
We're curious about your upgrade experience, your wishes for new versions and hints on how we can help you be more productive while building great apps on SAP Business Technology Platform.

Fun Facts



  • Version 2 was released on February 3, 2022 which means we almost managed to develop version 3 within one year.

  • The contributor with the most commits to the Cloud SDK is... dependabot. By a wide margin. Thanks for keeping our dependencies up-to-date 🙂

3 Comments