DEV Community

Nikola Mitrovic
Nikola Mitrovic

Posted on

How I Send SMS From My React App Using My Own Phone and SIM Card

Most tutorials on “sending SMS from your app” point you to services like Twilio, where you pay per message. That’s fine for small projects, but once you start sending a lot of texts, those charges add up quickly.

I wanted something different: a way to send SMS without paying a third-party provider — just using my own Android phone and SIM card. That’s why I built SimGate.

In this post I’ll show you how I wired up my phone to send an SMS directly from a simple React app with just one API call.

  1. The idea
    Install an app on your Android phone.
    The app connects to SimGate and exposes an API endpoint.
    Your frontend or backend makes a POST request with the phone number + message.
    Your phone’s SIM card sends the SMS.
    No middleman. No per-SMS fee. Just your device and your mobile plan.

  2. Setting up the phone
    Install the SimGate Android app.
    Log in and register the device.
    The app generates an API key you’ll use in your code.
    That’s it — your phone is now ready to act as a mini SMS gateway.

3.Sending an SMS:

Here’s the simplest possible curl example:

curl -X POST https://api.simgate.app/v1/sms/send \
  -H "Content-Type: application/json" \
  -H "x-api-key: <YOUR_API_KEY>" \
  -d '{
    "deviceId": "<YOUR_DEVICE_ID>",
    "to": "+15551234567",
    "message": "SMS from curl"
  }'
Enter fullscreen mode Exit fullscreen mode

Sending it from react is quite simple:

async function sendSms() {
  const res = await fetch("https://api.simgate.app/v1/sms/send", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": "<YOUR_API_KEY>",
    },
    body: JSON.stringify({
      deviceId: "<YOUR_DEVICE_ID>",
      to: "+15551234567",
      message: "Hello from my React app",
    }),
  });

  const data = await res.json();
  console.log("SMS response:", data);
}
Enter fullscreen mode Exit fullscreen mode

As long as your phone has connection SMS is shipped!

https://www.simgate.app

Top comments (0)