iMessage Node.js & TypeScript SDK
Send and receive iMessages from Node.js or TypeScript with Blooio's official iMessage SDK. Fully typed against the Blooio REST API, published to npm, with async/await, automatic retries with exponential backoff, and a webhook signature verifier you can drop into Express, Fastify, Hono, or Next.js route handlers.
Install
One command to add the iMessage Node.js / TypeScript SDK to your project.
npm install @blooio/sdk
# or
pnpm add @blooio/sdk
# or
yarn add @blooio/sdk
Send your first iMessage
This is the smallest working example — authenticate with your Blooio API key, then call the send-message method on the client.
import { Blooio } from "@blooio/sdk";
const blooio = new Blooio({ apiKey: process.env.BLOOIO_API_KEY });
await blooio.chats.sendMessage({
phone: "+15551234567",
body: "Hey Alex — thanks for booking a demo. Reply with any questions.",
});
Handle inbound iMessages and webhooks
Every inbound iMessage, delivery, read, and reaction event is POSTed to your webhook URL. Use the SDK's signature verifier to reject forged requests and deserialize the payload into typed objects.
import express from "express";
import { Blooio, verifyWebhook } from "@blooio/sdk";
const app = express();
app.post(
"/webhooks/blooio",
express.raw({ type: "application/json" }),
(req, res) => {
const event = verifyWebhook({
body: req.body,
signature: req.header("x-blooio-signature") ?? "",
secret: process.env.BLOOIO_WEBHOOK_SECRET,
});
if (event.type === "message.received") {
console.log("Inbound iMessage:", event.data.body);
}
res.sendStatus(200);
},
);
What the SDK gives you on top of raw REST
- 100% TypeScript — every endpoint, payload, and webhook event is typed
- Automatic retries with exponential backoff and jitter
- Works in Node 18+, Bun, Deno, and edge runtimes (Cloudflare Workers, Vercel Edge)
- Webhook signature verification — drop-in Express, Fastify, Hono, and Next.js helpers
- Streaming helpers for large inbound media downloads
- MIT-licensed and open source on GitHub
Node.js / TypeScript iMessage SDK FAQ
How do I install the Blooio iMessage Node.js SDK?+
Run npm install @blooio/sdk (or the equivalent pnpm / yarn command). The package is published to npm under @blooio/sdk and ships with TypeScript type definitions.
Does the iMessage TypeScript SDK work in Cloudflare Workers or Vercel Edge?+
Yes. The SDK uses the fetch API under the hood, so it runs in Node 18+, Bun, Deno, Cloudflare Workers, and Vercel Edge Functions without extra configuration.
How do I verify Blooio webhook signatures in Node.js?+
Import verifyWebhook from @blooio/sdk, pass the raw request body, the x-blooio-signature header, and your webhook secret. The function returns the parsed event or throws if the signature is invalid.
Does the SDK support sending attachments, polls, and FaceTime invites?+
Yes. The typed client exposes blooio.chats.sendAttachment, blooio.polls.sendPoll, and blooio.facetime.invite. Each method mirrors the REST API one-to-one.
Is the Node.js SDK open source?+
Yes, MIT-licensed and public on GitHub at github.com/Blooio/blooio-typescript-sdk. PRs and issues welcome.