COURIER

Controlling IoT using the Webhook Provider

AHAydrian Howard

Aydrian Howard

September 09, 2020

Courier Live Header

Riley Napier from our engineering team returned for our September 2nd Courier Live. Together we used the Courier Webhook Provider to send a notification using an unconventional channel, a BlinkStick Square.

Check out the video below to watch us:

  • Demo an application using a BlinkStick Square
  • Configure and add the Webhook Provider to an existing notification
  • Create an endpoint to accept and handle the Webhook Post from Courier
  • Send a test notification using the new Notification Designer Send tab

Be sure to Like the video and Subscribe to our YouTube channel.

Configuring the Webhook Provider

Courier allows for static and dynamic configuration of the Webhook Provider. By default, Courier sends a payload via POST or GET request to a specified url. For this project, we opted to use the dynamic configuration. This allowed us to specify destination configuration on a per recipient basis by supplying it in the webhook object in the recipient profile.

// Profile
{
  "webhook": {
    "url": "https://blinkstick-server.herokuapp.com/api/courier",
    "Method": "POST"  // optional: defaults to POST
  }
}

You can learn more about Dynamic Destination configuration in the Courier Docs.

Accepting the POST

The url supplied to the destination configuration needs to accept a POST and return a status code of 200. If Courier doesn't receive a 200 response, it will attempt to retry the POST. For our project, we used a Next.js application deployed to Heroku. To create our route, we added a courier.js file to the /pages/api directory.

// /pages/api/courier.js
export default (req, res) => {
  if (req.method === "POST") {
    req.context.io.emit("alert", req.body);
    res.status(200).send("ok");
  } else {
    res.satus(405).send();
  }
};

This results in a route that will accept a request and emit an alert event using Socket.io if the request method is a post. You can find the full blinkstick-server code on GitHub.

Handling the alert

Now that the webhook has been accepted and an event has been emitted, the client needs to handle it. Our client is a simple Node.js application running locally on the machine connected to the BlinkStink Square. We use the Socket.io Client to connect to the server running in Heroku. We can handle the alert event by adding the following listener.

const io = require("socket.io-client");
const blinkstick = require("blinkstick");
const player = require("play-sound")();
const device = blinkstick.findFirst();
const socket = io("https://blinkstick-server.herokuapp.com/");
socket.on("alert", (data) => {
  console.log(data);
  device.morph("red", function () {
    device.morph("orange", function () {
      device.morph("yellow", function () {
       device.morph("green", function () {
          device.morph("blue", function () {
            device.morph("purple", function () {
              device.morph("#000000");
            });
          });
        });
      });
    });
  });
  player.play("./media/youve-got-mail.mp3", (err) => {
    if (err) console.log(`Could not play sound: ${err}`);
  });
});

The listener uses the BlinkStick Node.js module to make the Square transition through all the colors of the rainbow. And then for added fun, we used the play-sound package to play a sound through the connect computer's speakers. You can find the full blinkstick-client code on GitHub.

Now this is just a simple exercise of how Courier can trigger an IoT device. There's so much more that can be done. You could use the data being passed in the webhook payload. You could have this running on a Raspberry Pi. The only limit is your imagination (and maybe your pocketbook). Definitely sign up for a free Courier Account and let us know what you create.

Is there something you’d like to see us do using Courier? Let us know and it might be the subject of our next Courier Live. We stream a new Courier Live every Wednesday at noon Pacific. Follow us on Twitch to be notified when we go live.

-Aydrian

Similar resources

How Product Teams Build, Test and Ship Multichannel Notifications in Design Studio — cover
Product ManagementCourier

How Product Teams Build, Test and Ship Multichannel Notifications in Design Studio

Product teams need to build, test, and ship notifications across multiple channels without filing an engineering ticket every time. Courier's Design Studio is the workspace for that: a template builder, visual channel routing, omnichannel testing, and publishing in one place. This post walks through the traditional template designer paradigm, how it splits effort across too many tools, and outlines a path for product and growth teams to ship transactional, product, and marketing notifications from a single workspace.

By Kyle Seyler

March 12, 2026

EU Data Residency for Notifications: What Engineering Teams Need to Know — cover
EngineeringCourier

EU Data Residency for Notifications: What Engineering Teams Need to Know

Courier supports EU data residency through a dedicated datacenter in AWS EU-West-1 (Ireland), with full API feature parity, same-workspace dual-region access, built-in GDPR deletion endpoints, and localization support for multilingual notifications. Engineering teams can switch to EU hosting by changing a single base URL with no workspace migration or downtime required.

By Kyle Seyler

March 09, 2026

Customer Engagement Platforms Are Splintered. Message Orchestration Is the Fix — cover
Notifications LandscapeCourierProduct Management

Customer Engagement Platforms Are Splintered. Message Orchestration Is the Fix

Customer engagement platforms are splintered. Some are built for campaigns, others for support automation, and others treat messaging as a transactional delivery problem. The result is collisions, blind spots, and message fatigue. The highest-leverage fix is solving the lifecycle-to-product and transactional vector with a message orchestration layer: one system that routes, suppresses, prioritizes, and observes messages across channels. Think air traffic control for user communications.

By Kyle Seyler

March 03, 2026