Salesforce IoT Nutellator NodeJS Proxy
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Enrico Murru (

IoT Proxy Server

The proxy has been developed to link a connected device (e.g. Arduino with Ethernet/WiFi shield) to Salesforce, using Platform Events.

The device should make a POST call to (or http://localhost:3000/api/level) passing the following JSON as body:

    "level": 30,
    "device_id": "XXXXXXXX"

Providing a Basic Auth autentication, with the following header:

Authorization: BASIC BASE64(username:password)
Content-Type: application/json

Users are stored in a PostgreSQL database (see utils\db.sql): the database must initialized locally with:

var utils = require('./utils');

Or in Heroku with:

heroku run node utils/dbinit.js

The proxy logs in to Salesforce using the provided username/password with a OAuth Username-Password flow and writes the Nutellevent__e platform event: an orchestration handles this event.

Run Locally

Update the .env file with the following values:

  • SF_CLIENT_ID: Salesforce Connected App Client Key
  • SF_CLIENT_SECRET: Salesforce Connected App Client Secret
  • SF_USERNAME: Salesforce username
  • SF_PASSWORD: Salesforce password + token
  • DATABASE_URL: PostgreSQL connection string

Run with foreman:

npm install foreman -g
nf start