BrakeCODE + NiM Alert Feature

Gazing into multiple monitors each day and in turn multiple tabs of multiple windows of said multiple monitors (I'm back down to 4 now)... I wanted a way to quickly identify when my builds were finishing without obviously going back to the browser tab where I had GitHub opened... and hopefully to the correct page buried under the GitHub Actions application tab (an even deeper infinity mirror). Since NiM shares a tiny bit of browser real estate already (assuming it's not hidden), I thought it would be a useful feature to add. So, I'll briefly explain NiM's alert feature...

What is it?

nimBadgeAnimation

So it's a simple API that any BrakeCODE user has access to using their apikey where you can send alerts to your NiM browser extension and have then show up as notifications and be displayed as scrolling badge messages as well.

Screenshot-2023-01-22-200816

Screenshot-2023-01-22-201056

How to use it?

Messages can be sent from any http client (curl) so this is how I ended up using it to send GitHub pipeline alerts...

curl -k -L https://8w1i.ngrok-dns.june07.com/api/v1/alert?appId=alerts -H 'Content-Type: application/json' -H "x-api-key: { \"apikey\": \"***\" }" -d "{\"payload\": {\"topic\": \"notification\",\"title\": \"GitHub workflow completed.\",\"content\": \"june07/nimv3\",\"badge\": {\"text\": \"june07/nimv3\",\"color\": \"#FF9800\"}}}"

Screenshot-2023-01-22-202025
8w1i.ngrok-dns.june07.com is simply a tunnel to my BrakeCODE local development environment. As you can see from the image below the NiM notification interface shows the content of the message sent above which happens to be the GitHub project name but could be anything useful.

Screenshot-2023-01-22-201659

The badge text and color is also customizable per message, and the extension will scroll unread messages every minute (or configurable interval), toggling from message scrolling to a count of unread vs total notifications (5 and 7 respectively in this example case).

That's it!

Thank for reading

Privacy | Terms