We use optional, privacy-safe analytics to understand which pages help visitors. Nothing optional runs until you choose. Privacy policy

Skip to content
Example AvailableDirect HTTP API

Send SMS from React with the SendiMessage API

React itself never talks to SendiMessage directly — and that's the point. Browser code cannot hold your API key, so the React pattern is a thin call to your own backend route, which performs the actual send server-side.

The example shows both halves: the component calling your endpoint, and where the real send belongs. Pair it with the Next.js, Express, or Laravel guide for the server half — all three can use an official SDK.

Request This SetupBook an Integration Review

What this integration enables

Order and status notifications
Trigger messages from React when records change state.
Appointment reminders
Scheduled tasks that message customers before a booking.
Support updates
Notify customers as their request moves forward.
Reply handling
Receive incoming replies on a webhook route in the same codebase.

Architecture

How it fits together: Your application event, then React server code, then SendiMessage API, then Managed messaging line, then Webhook events.
  1. Your application eventAn order ships, a booking nears, a ticket updates
  2. React server codeBuilds the request with credentials from the environment
  3. SendiMessage APIPOST /send-message returns the queued message
  4. Managed messaging lineSMS, or iMessage on supported lines and destinations
  5. Webhook eventsDelivery status and incoming replies post back to your endpoint

Example request

React
// The React side calls YOUR backend — the SendiMessage key stays on the server.
async function notifyCustomer(number: string, content: string) {
const res = await fetch("/api/notify", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ to, content }),
});
if (!res.ok) throw new Error("Notification failed");
return res.json(); // { handle: "4e828182-…", status: "QUEUED" }
}
// Your server route (Next.js / Express / Laravel …) performs the real send
// with the official SDK (npm install sendimessage) or a plain POST to
// https://api.sendimessage.com/v1/send-message
// using the X-API-Key / X-API-Secret pair from server-side env vars.

Do not place SendiMessage API credentials directly in browser code. Send requests through your own server route or backend.

Delivery events and incoming replies

Point a React route at your webhook URL to receive delivery status and incoming replies. Verify the signature header before processing.

webhook event
// "outbound" event → your react endpoint
// Verify the SendiMessage-Signature header (t={timestamp},v1=HMAC-SHA256 of
// "{timestamp}.{raw body}", keyed with your webhook secret), then use
// GET /v2/messages/{message_handle} for authoritative state and match it to
// your contact_id in react.

Limitations and honest notes

  • iMessage delivery is available on supported messaging lines and destinations. Recipients without iMessage receive SMS when fallback is configured — never assume universal iMessage availability.
  • Messages are accepted asynchronously — the API returns status QUEUED and final status arrives via webhook or the message endpoints.
  • No official SDK for this ecosystem yet — the example uses plain HTTP against the REST API. Official SDKs are published for JavaScript/TypeScript (npm: sendimessage), Python (PyPI: sendimessage), PHP (Composer: sendimessage/sdk), and Go (github.com/sendimessage/sendimessage-go). Every SDK is dependency-free and covers the full public API surface.
  • Do not place SendiMessage API credentials directly in browser code. Send requests through your own server route or backend.

Security considerations

  • Do not place SendiMessage API credentials directly in browser code. Send requests through your own server route or backend.
  • Expose a minimal endpoint on your own backend (e.g. POST /api/notify) and call SendiMessage from there.
  • Rate-limit and authenticate that endpoint — it can send real messages.

Frequently asked questions

Is there an official React package for SendiMessage?
Not a framework-specific one. SendiMessage is a plain REST API, so your framework's standard HTTP client is all that's required — the example on this page is complete. Official SDKs are published for JavaScript/TypeScript, Python, PHP, and Go.
Can React receive message replies?
Yes. Add a route that accepts SendiMessage webhook POSTs; incoming replies arrive as receive events. Correlate them with your records via the message_handle and conversation data in the event.
Can I call the API directly from the browser?
No. Browser code must never hold your API key. Create a small route on your own backend that performs the send, and call that route from your frontend.

Ready to connect React?

Request a messaging line and a SendiMessage integration specialist will review your React workflow and guide the setup.