AI app builder
Add SMS to a Lovable app: send and receive texts through your own phone
Published and updated
A Lovable app can send SMS through your own Android phone with one prompt. Save your textbee API key as a Lovable secret, paste the prompt from this page into the project chat, and Lovable writes a server function that calls the textbee send endpoint. For replies, Lovable creates a public endpoint in your app and you register its URL as a textbee webhook. No Twilio account, no sender registration, and the free plans on both sides cover a test.
- Send
- HTTP POST
- to the textbee send endpoint
- Receive
- Webhook
- MESSAGE_RECEIVED, flat JSON
- Pace
- 10 to 15 / min
- per Android phone
- textbee code
- None
- uses what the tool ships today
What you need
- A Lovable project. Secrets, custom connectors and custom MCP servers work on every Lovable plan, including Free.
- A textbee account with the Android app installed on the phone that holds the SIM, and an API key from the dashboard.
- A second phone, or a friend, to text the textbee phone when you test replies.
- The textbee app on the phone. Download the app, then create an API key in the dashboard.
Send SMS from Lovable
Lovable writes the code. Your job is the key and the prompt. In projects created since May 2026, Lovable puts API calls in a TanStack Start server function. Older React and Vite projects get an edge function instead. Both run on the server, so the key never reaches the browser.
Save the key as a secret
Open More, then Settings, then Secrets, and click Add secret. Lovable also asks for a key through a secure input in the chat when its code needs one. Names that start with VITE_ are rejected, because those end up in the browser bundle.
Field Value Name TEXTBEE_API_KEY Value Your key from the textbee dashboard Paste the prompt
Copy the prompt further down this page, change the What I want line to your feature, and send it in the project chat. Lovable plans the change, writes the server function and wires a button or an event to it.
Check the code it wrote
The core of the server code is one fetch call. If you see the key in a file under src/components or in anything the browser loads, ask Lovable to move the call into a server function.
send-sms.tsexport async function sendSms(to: string, message: string) { const res = await fetch('https://api.textbee.dev/api/v1/gateway/send-sms', { method: 'POST', headers: { 'x-api-key': process.env.TEXTBEE_API_KEY ?? '', 'Content-Type': 'application/json', }, body: JSON.stringify({ recipients: [to], message }), }) if (!res.ok) throw new Error(`textbee returned ${res.status}`) return res.json() }Send a test to your own number
Ask Lovable for a test button that texts your number, for example +12015550123, and click it in the preview. The text leaves your phone within a minute and shows as sent, then delivered, in the textbee dashboard.
Receive SMS in Lovable
Replies need a public URL that textbee can post to. Lovable creates one when you ask it to handle incoming messages. A custom connector does not help here: Lovable routes outgoing calls through connectors, not incoming webhooks.
Ask for a webhook endpoint
Prompt: "Create a public endpoint that receives textbee webhooks, checks the X-Signature header with TEXTBEE_WEBHOOK_SECRET, and saves sender, message and receivedAt to a messages table." Click Generate when Lovable asks for TEXTBEE_WEBHOOK_SECRET, then Copy, so you have the value for textbee.
Copy the endpoint URL
A TanStack route looks like https://project--<id>-dev.lovable.app/api/public/... in the preview and drops -dev on the published app. An edge function looks like https://<ref>.supabase.co/functions/v1/<name>. Use the published URL so replies keep arriving when the editor is closed.
Register it in textbee
In the textbee dashboard open Webhooks, add the URL, select MESSAGE_RECEIVED and paste the same signing secret. Text the textbee phone from another number and the row appears in your table.
Paste this prompt into Lovable
The prompt below carries the endpoints, the payloads, where the key may live and the Lovable details from this page. Change the line that starts with What I want, and Lovable builds the feature without guessing an endpoint.
Prompt for your AI agent
Paste it into the Lovable chat. It carries the textbee API facts and the Lovable details the agent needs, so it does not guess.
Add SMS to the app I am building in Lovable. Use textbee, an SMS gateway that sends and receives SMS through my own Android phone.
Facts about the textbee API. Use only these. Do not invent endpoints or fields.
- Send an SMS: POST https://api.textbee.dev/api/v1/gateway/send-sms with the header x-api-key: <TEXTBEE_API_KEY> and a JSON body like {"recipients": ["+12015550123"], "message": "Hello"}. recipients must be a JSON array of E.164 numbers, even for one number. Optional fields: deviceId, simSubscriptionId, scheduledAt (ISO 8601, in the future). The response is {"data": {"success": true, "smsBatchId": "..."}}.
- Check delivery or read replies: GET https://api.textbee.dev/api/v1/gateway/messages with the same header. Filters: direction=received, smsBatchId=<id from the send>, from and to as ISO timestamps. Each row has a status such as sent, delivered, failed or received.
- Receive an SMS: textbee posts JSON to a webhook URL I register in the dashboard. A MESSAGE_RECEIVED delivery has these top-level fields: smsId, message, deviceId, webhookSubscriptionId, webhookEvent, idempotencyKey, sender, receivedAt. The header X-Signature holds an HMAC-SHA256 hex digest of the raw body, keyed with the signing secret I set on the webhook. Retries reuse the same idempotencyKey.
- Limits: One Android phone sends roughly 10 to 15 messages a minute. Text only, no MMS. Messages over 160 characters are split into segments.
Rules:
- Store the API key as a secret named TEXTBEE_API_KEY. Call textbee only from server-side code, never from code that runs in the browser.
- Do not ask me to paste the real key into this chat. Tell me where to add the secret instead.
- For incoming texts, create a public server endpoint, check the X-Signature header against a secret named TEXTBEE_WEBHOOK_SECRET, and ignore a repeated idempotencyKey.
What I want: Text the customer a reminder 24 hours before each booking, and save their replies next to the booking.
Lovable specifics you should know:
- New Lovable projects run on TanStack Start: put the textbee call in a server function. Older React and Vite projects use an edge function in the built-in backend.
- Secrets are added in More > Settings > Secrets or through the secure input in chat. Names starting with VITE_, SUPABASE_ or LOVABLE_ cannot be used.
- Incoming webhooks need a public endpoint in the app. They do not go through Lovable connectors.
- Lovable Cloud phone sign-in only offers its own list of cloud SMS providers, such as Twilio and Vonage, with no custom hook. For login codes through textbee, store a short-lived code in a table and send it with the server function.
Build it, tell me where to add each secret in Lovable, and add a way to send one test message to my own number.Features to build
- Booking reminders
- A scheduled server function that finds tomorrow's bookings and texts each customer. Ask Lovable to mark each booking as reminded so a rerun never texts twice.
- Login codes
- Lovable Cloud phone sign-in has no slot for a custom sender. Ask for a codes table, a server function that sends a six-digit code with textbee, and a second one that checks it and signs the user in.
- Owner alerts
- Text yourself when a form is submitted, an order is paid or a review comes in. One recipient, your own number, no new UI.
- Two-way inbox
- The webhook endpoint saves every reply, and a Messages page lists them by sender with a reply box that calls the send function.
Why Lovable builders text from their own phone
- Test on day one
- A cloud provider trial often texts only numbers you verified first. A free textbee account texts any number from the phone you paired, so the reminder flow you just prompted works for real users the same afternoon.
- No registration wait
- Many providers ask for a sender or brand registration before automated texts go out. textbee sends from an ordinary mobile number, so there is nothing to file and nothing to wait for.
- Replies that land in the app
- Customers answer a real number they recognize. Every reply reaches your Lovable endpoint as flat JSON, ready to save next to the booking or the order.
A cloud SMS provider in Lovable vs textbee in Lovable
| What you care about | Cloud SMS provider | textbee |
|---|---|---|
| Setup | Connect the provider, buy a number, complete any sender registration, then prompt | Pair a phone, save TEXTBEE_API_KEY as a secret, paste one prompt |
| Sender the contact sees | A rented virtual number, or an alphanumeric sender where the country allows it | Your own mobile number, which your contacts already have saved |
| Monthly cost | Per message, plus number rental and carrier surcharges in some countries | A flat plan with messages included: Pro is $14.99 a month for 5,000 messages. No per-message fee, no number rental, no carrier surcharge. |
| Throughput | Set by the provider tier and by sender registration | One phone sends roughly 10 to 15 messages a minute. Add phones to scale. |
| Replies | Inbound webhook from the provider, or the provider app in the tool | textbee webhook: flat JSON, signed with HMAC-SHA256 |
| Where the message leaves from | The provider data center | An Android phone you own, plugged in, on Wi-Fi or mobile data |
| Lovable cost | Build credits for the prompts, plus the provider bill | Build credits for the prompts only. Secrets work on the Free plan |
Per-message prices by provider and country, with sources and dates, are on the provider comparison pages.
What works and what does not
Works today
- Texts from any server function or edge function Lovable writes
- Replies saved to your app through a public webhook endpoint
- Scheduled sends, such as reminders, from a scheduled function
- Login codes that your app generates and checks itself
Not with this route
- The built-in Lovable Cloud phone sign-in, which only lists its own providers
- Calls from browser code: the key must stay on the server
- A one-click Lovable connector for textbee; the custom connector route needs a workspace admin
- MMS
What Lovable charges
Secrets, custom connectors and custom MCP servers are available on every Lovable plan, including Free. The Free plan gives 5 build credits a day, up to 30 a month. Editing code by hand needs Pro or higher. docs.lovable.dev, checked on October 22, 2026. textbee itself charges a flat monthly plan with messages included; see pricing.
Frequently asked questions
Can I use textbee for Lovable Cloud phone sign-in?
Not inside the built-in sign-in. Lovable Cloud only lists its own cloud SMS providers, such as Twilio and Vonage, and has no custom hook. Two routes work: let your app send and check its own codes through textbee, or connect your own Supabase project and use its Send SMS Hook.
Should I add textbee as a Lovable custom connector?
Only if several projects in one workspace should share the key. A workspace admin creates it under Connectors, + and Custom connector, with API key in a custom header and x-api-key as the header name. For one project, a plain secret is simpler. Either way, incoming webhooks still need an endpoint in the app.
Can I add the textbee MCP server to Lovable?
Yes, under Connectors, + and MCP server, with https://mcp.textbee.dev/mcp as the URL. It lets the build chat send you a test text or read a reply while you build. It is never part of the published app, so your app still calls the REST API from a server function.
Why does Lovable reject my VITE_TEXTBEE_API_KEY secret?
Names that start with VITE_ are bundled into browser code, so Lovable refuses them as secrets. Use TEXTBEE_API_KEY and read it only in server code.
My webhook works in the preview and stops after I publish. Why?
The preview URL contains -dev and lives with the editor session. Register the published URL in the textbee dashboard, without -dev, and update the webhook when you move to a custom domain.
What do I do if Lovable writes the textbee call in a React component?
Reply in the chat: "Move the textbee call into a server function and read TEXTBEE_API_KEY from the environment. The browser should only call my server function." Then check that no file the browser loads contains the key name.
How long does the setup take?
About ten minutes: install the textbee app, pair the phone, create an API key, save it as a Lovable secret and send the prompt. Replies add one more prompt for the endpoint and a webhook in the textbee dashboard.
Do the texts come from Lovable or from my phone?
From your phone. Lovable only runs the code that asks textbee to send. Recipients see your mobile number, and the message counts against your SIM plan and your textbee allowance.
Sources
- docs.lovable.dev, checked on October 22, 2026
- docs.lovable.dev: Secrets, checked on October 22, 2026
- docs.lovable.dev: Connect any API, checked on October 22, 2026
- docs.lovable.dev: Custom connectors, checked on October 22, 2026
- docs.lovable.dev: Phone sign-in, checked on October 22, 2026
Read next
- Appointment reminder text messages from your own Android number (SMS API)
- SMS OTP and verification API: text verification codes from your own number
- Build with AI: one prompt for every builder
- Webhooks documentation
- Add SMS to a Bolt app: server functions, secrets and replies from your own phone
- Add SMS to a v0 app: Next.js route handlers that text from your own phone
- All integrations
Your phone is already an SMS gateway. Switch it on.
Set up in minutes and send your first message for free. No credit card, no per-message fees, no carrier contracts.
Need self-hosting help or a custom integration? See services