Pre-built code blocks

Alerts by text and email

Owner alerts — Twilio SMS + email, dependency-free & fail-safe

For when the answer to “Text or email me when something breaks” is yes.

Text or email yourself when something matters (an export failed, the shared API key is out of credit) with no npm dependency and no risk to the request path — it never throws, throttles so failures can't spam you, and no-ops when…

A small bell on a bracket with two cords running from it, one to a rounded tile and one to a sealed envelope, each cord fitted with a half closed valve

Skip the rebuild

You do not write this one. It arrives in your project as ordinary source you can read, change and keep, with its audit record and its caveats beside it.

  1. Download the Playground. It is free and runs on your own machine.
  2. Start a new app and tick “Text or email me when something breaks”.
  3. This block is written in, along with anything else you ticked.

Download the Playground See the other blocks

The mistake it removes

The naive version calls Twilio from the wrong place or lets a paging failure crash the very request it was trying to report. And a Twilio auth token in client code is a full-account credential leak.

What is already handled

Each of these was checked by running the code, not by reading it.

What the audit found

Named rather than summarized. The reasoning behind each one ships inside the block, so it travels with the code instead of living on a page you have to trust.

What you still have to do

A copied file cannot own your secrets, your host or your legal obligations. This is the part the block deliberately does not claim.

What lands in your project

node

  • node/notify.js

createNotifier(config?) -> { sms, email, owner, smsConfigured, emailConfigured }. Also exports isCreditError(status, msg). Reads TWILIO_*/RESEND_* from env by default, or pass explicit config. Dependency-free (raw REST + fetch).

What you supply

Licensed MIT. It is a starting point, not a finished product.

Get it

Download the Playground See the other blocks

Nothing here is locked. The files are yours, in your folder, under a permissive license.

Questions

Is Alerts by text and email audited?
Yes. A full due-diligence audit was run on 2026-07-18 and the verdict was a pass.
What do I still have to do myself?
Keep this on the server and out of every client bundle. A Twilio auth token is a full-account credential; there is deliberately no vanilla build, but nothing stops a host importing the module into browser code.
How do I get this code?
Download the Playground, start a new app, and tick “Text or email me when something breaks”. The block is written into your project as ordinary source you can read and edit.

All pre-built code blocks · Learn to build from zero · The coding guide