Get a text when someone signs up for your app
Yes. Homing Pigeon (homingpigeon.dev) lets your app text your phone each time a new user signs up. The call runs in the background, so the signup never waits on the text or fails because of it, and your coding agent can add it to the app you already have.
What to tell your agent
Use Homing Pigeon to text me when someone signs up for this app.
Your agent asks for your number, you read back the six-digit code, and it does the rest.
How it works in code
Add this helper as text-me.js. It reads your key from HOMINGPIGEON_API_KEY, and it never throws, so nothing that calls it has to wait or handle an error:
function textMe(message, idempotencyKey) {
fetch("https://homingpigeon.dev/v1/send", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.HOMINGPIGEON_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({ message, idempotency_key: idempotencyKey }),
signal: AbortSignal.timeout(5000)
})
.then(async (res) => {
if (!res.ok) console.warn("Text alert failed:", (await res.json()).error.message);
})
.catch((err) => console.warn("Text alert failed:", err.message));
}
module.exports = { textMe };
Then call it in your signup route, right after the new user is saved and before the response. Replace createUser with your own code and use your own fields:
const { textMe } = require("./text-me");
app.post("/signup", async (req, res, next) => {
try {
const user = await createUser(req.body);
textMe(`New signup: user ${user.id}.`, `signup-${user.id}`);
res.redirect("/welcome");
} catch (err) {
next(err);
}
});
Good to know
- There is no
awaitin front oftextMe, so the redirect goes out right away and the text is sent in the background. If the send fails or takes longer than 5 seconds, the failure goes to your server log and the new user never sees it. - The text goes out only after
createUsersucceeds, so a signup that fails validation or hits a duplicate email stays quiet. - The text names the user ID, not the email, so people's personal details stay out of your text messages. Look the user up by ID when you want more.
- The user ID in the idempotency key means a retried request never texts you twice for the same signup.
- This needs Node 18 or later, which has
fetchbuilt in. Express 5 also passes errors from an async route tonexton its own, while Express 4 needs thetryandcatchshown here. - Fire-and-forget suits a server that keeps running, such as a VPS or a container. On a serverless host that can freeze the function once the response is sent, put
returnin front offetchin the helper andawaitin front oftextMein the route. It still never throws, so the signup still cannot fail because of it. - The limit is 20 texts a minute, and each signup uses one of your texts. If bots start filling in your form, add a captcha or turn these texts off until it stops.
- Verify your phone with
npx -y homingpigeondev verify +15551234567, then again with the six-digit code it texts you.npx -y homingpigeondev keythen prints your key. Set it asHOMINGPIGEON_API_KEYin your server's environment and keep it out of git. - Messages are limited to 480 characters and go only to the US mobile number you verified. Keep them plain, with no links. Delivery is not guaranteed, so treat each text as a heads-up.
Get started
Add Homing Pigeon to Claude Code, then ask for what you want:
claude mcp add homingpigeondev -- npx -y homingpigeondev mcp
You get 50 free texts every month, on US mobile numbers. See more use cases.