nRF9160: Cloud Client

This sample connects to, and communicates with a compatible cloud service using the respective cloud backend firmware library. The sample connects via cellular network (LTE) and publishes a custom string in intervals or upon a button trigger, to the cloud service.


The Cloud Client sample demonstrates how the generic Cloud API can be used to interface with multiple cloud backends. The current version of the sample supports the following libraries as cloud backends:

To swap between the supported libraries, change the option CONFIG_CLOUD_BACKEND to match the configuration string of a compatible cloud backend. The identifying string for the different cloud backends are listed in the following table:

Cloud Backend

Configuration String

NRF Cloud





  • One of the following development boards:

Building and running

This sample can be found under samples/nrf9160/cloud_client in the nRF Connect SDK folder structure.

See Building and programming a sample application for information about how to build and program the application.

The sample is configured to compile and run as a non-secure application on nRF91’s Cortex-M33. Therefore, it automatically includes the nRF9160: Secure Partition Manager that prepares the required peripherals to be available for the application.


For configuring the different cloud backends, refer to the documentation on nRF Cloud library and AWS IoT. Each cloud backend has specific setup steps that must be executed before it can be used.


The nRF9160 DK and Thingy:91 come pre-flashed with the certificates required for a connection to nRF Cloud. No extra steps are required to use the Cloud client sample with nRF Cloud.


The configurations used in the sample are listed below. They are located in cloud_client/src/prj.conf.


Decides the cloud backend to be used.


Publishes a message to cloud sequentially.


Publishes a message to cloud upon a button press.


Modifies the message published to the cloud service.


Modifies the interval within which the message is published to the cloud service.


To output data in the terminal window located in the nRF Cloud web interface, the data format must be in JSON format.

Functionality and Supported Technologies

The communication protocol supported by the sample is dependent on the cloud backend that is used.


The sample uses the following functions:

Cloud events used in the sample

The sample uses the following cloud events:


Not all functionalities present in the generic cloud API are used by the different cloud backends.


This sample uses the following nRF Connect SDK libraries and drivers:

In addition, it uses the Secure Partition Manager sample: