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.
Showing results for 
Search instead for 
Did you mean: 


SAP IoT Application Enablement is part of the SAP Leonardo Portfolio enabling companies to develop their own IoT applications using a powerful set of business services (application services, Big Data and analytics, developer experience) – in a quick, secure and scalable way [1]. The solution helps you to model digital twins of your real-world object to monitor, track and analyze. One of the main features is the extensive REST-based API providing services to store and retrieve data efficiently for a thing, company and service personel [2].

To make the life of application developers easier, a SDK for SAP IoT Application Enablement is available on GitHub. The SDK provides a NodeJS package that acts a thin wrapper over the API of SAP IoT Application Enablement. The Wrapper abstracts the consumption of the API to fasten your application development for Cloud Foundry [3] providing the following features for now:

  • Abstraction of request handling

  • Performance optimized update of expired OAuth-Tokens [4]

  • Simplify resource-paths definition by setting microservices as base URIs

  • Streaming the API response

The SDK is available open source, free for everyone!

This blog post helps you jump start the application development with the new SDK!


Hands on

In the following hands-on session, we will implement a simple node-application running locally accessing data stored in the Big Data storage of SAP IoT Application Enablement.


  • Node.js development environment [5]

  • A tenant for SAP IoT Application Enablement

  • The OAuth Client Credentials for your tenant (you have received them while onboarding your Application Enablement tenant)


1. Generate a node.js application:

Create a new folder called sdk-demo. Open the command prompt in this folder, execute npm init -f. This initializes your node application. Finally, you should find a file called package.json in your folder.

2. Install the SDK:

Next, we install the SDK for SAP IoT Application Enablement as a dependency of our application. The SDK is published via the public GitHub organization of SAP [6]. You can set the SDK as a dependency to our project by adding the following section to your package.json:
"dependencies": {
"iot-application-services-sdk-nodejs": "git+ssh://"

Afterwards, re-open your command prompt and execute npm install. This will install all the dependencies specified in the package.json.

3. Configuration

In next step, we must configure the SDK to access your tenant of SAP IoT Application Enablement. There are three options to configure the SDK:

  1. You can set the necessary variables in your cloud foundry environment,

  2. You can create a file called .env which includes the variable definition in the root of your project and

  3. You can pass a JSON-object to the constructor of the SDK, which includes the variable definitions.

In this tutorial, we will use option 2.) and specify all environment variables in the .env file. So, please create a file called .env and add the following content to the file:
AE_OAUTH_CLIENT_ID = <your client-id goes here>
AE_OAUTH_CLIENT_SECRET = <your client-secret goes here>
AE_TENANT = <your tenant, e.g. ‘sap-iotaeexplore’>

Please make sure, to replace the placeholders (<…>) with the information of your tenant.

4. Usage of the SDK

Now we create the main part of our application, which calls the API of SAP IoT Application Enablement. For this demo purpose, we will request a list of all Things created in our tenant and log the response to the console. The list of all things can be requested via the API endpoint documented in [7].

To access the endpoint, create a file called index.js in the root of your project. Next, copy and paste the following code to this file:
const NodeAE = require('iot-application-services-sdk-nodejs')
const nodeAE = new NodeAE()</code>

// set the base URI for the NodeWrapper
nodeAE.setBaseURI('appiot-mds') // 'appiot-mds' = the app of the API we will use in the following

// now we can use plain http methods to send requests (post, get, put, delete)
const loadingThings = nodeAE.get('/Things')
function success (oResponse) {
console.log(JSON.parse(oResponse.body)) // will print all Things on the console
function error (oError) {
throw oError

Now you can start the application. Cheers!



This blog post introduced the SDK of SAP IoT Application Enablement and demonstrated the consumption of the API services offered by SAP IoT Application Enablement. But, this is just a starting point! The API offers a broad range of functionalities to consume your data. You can find further documentation about the SDK and some examples here [8].