To add SMS to a Bolt.new app, save your Telmian API key as a Bolt Cloud secret (database icon > Secrets) and ask Bolt to create server functions that call the Telmian REST API. Your browser code only calls those functions, never Telmian. Test free with sandbox numbers, then switch to a live key after your first top-up.
| What | Where in Bolt |
|---|---|
| TELMIAN_API_KEY | Database icon > Secrets |
| Calls to Telmian | Server functions (created by prompting Bolt) |
| Logs of each call | Database icon > Server Functions > View Logs (last hour) |
| Changes on the published site | Publish > Update |
Get a sandbox key
Sign up at https://app.telmian.com and get a sandbox key. It starts with sk_test_. The sandbox is free, needs no card, and only simulates SMS, so nothing real is sent.
Save the key as a Bolt secret
In your Bolt project, click the database icon in the top menu, then Secrets. Set Name to TELMIAN_API_KEY (names are case-sensitive), paste the key into Value and click Save. If Secrets does not open, ask Bolt to add a database first. Do not put the key in .env: in Bolt, .env is part of the project code and editors can see it.
Ask Bolt for two server functions
Secrets only work inside server functions, which run on Bolt's servers, not in the browser. Name the secret and the API in your prompt. Bolt deploys server functions by itself.
Create two server functions, send-code and check-code. Both read the secret TELMIAN_API_KEY and call https://app.telmian.com/v1 with fetch and the header Authorization: Bearer <key>. send-code posts {phone} to /verify with an Idempotency-Key header (one id per signup attempt). check-code posts {phone, code} to /verify/check and returns valid. Never put the key in frontend code or .env. The frontend only calls these functions.Check what the functions send
The server function should make these two calls. Telmian creates the code and sends it, so your app never stores codes. If a send fails, retry only with the same Idempotency-Key.
const res = await fetch('https://app.telmian.com/v1/verify', { method: 'POST', headers: { Authorization: `Bearer ${TELMIAN_API_KEY}`, 'Content-Type': 'application/json', 'Idempotency-Key': signupAttemptId }, body: JSON.stringify({ phone }) }); const check = await fetch('https://app.telmian.com/v1/verify/check', { method: 'POST', headers: { Authorization: `Bearer ${TELMIAN_API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ phone, code }) }); const { valid } = await check.json();Test with the sandbox numbers
Enter +393000000001 in your app: the code is always 000000. Enter +393000000002 to see a failure. To see what happened, open the database icon > Server Functions > View Logs (logs cover the last hour only).
Go live
In the Telmian panel, set an approved business name (it appears inside the SMS text), top up by card from €5, and create a key that starts with sk_live_. Replace the value of TELMIAN_API_KEY in Bolt's Secrets, then click Publish > Update so the published site gets your changes.
Optional: connect the Telmian MCP while building
Bolt can add custom MCP connectors from the chatbox plus icon > Connectors > Manage connectors > Custom MCP server. Use URL https://app.telmian.com/mcp, HTTP transport and MCP OAuth, then sign in in the browser. Bolt's agent can then use Telmian's tools while you build. Real charged sends from the AI stay off unless you tick it at consent. This is a build-time extra only: your published app still uses the server functions and the secret.
Questions
Can I put the Telmian key in .env in Bolt?
No. In Bolt, .env values are part of the project code, editors and co-owners can see them, and any value read in browser code ends up on the published site. Use database icon > Secrets and read the key only in a server function.
Does Bolt support phone number login with SMS?
Bolt's authentication settings list email, Google and anonymous sign-in, not phone. The simple path is to keep that login and add phone verification with Telmian's OTP in a server function. If you connect your own Supabase project (Pro or Teams plan), Telmian can also act as Supabase's Send SMS hook, but Bolt's docs do not describe that setup.
How much does SMS cost?
€0.05 per SMS segment to mobile numbers in 44 European countries, plus VAT. You prepay by card from €5, with no monthly fee and no contract. SMS refused by the network or not delivered are refunded automatically. The sandbox is free.
Can my Bolt app send reminders or alerts too?
Yes, with the same server function pattern. Call POST /v1/messages with an approved template (GET /v1/templates lists them). Reminders can be scheduled with send_at. Free text is only for alerts to your own verified numbers.
Why does my published site not show the SMS feature?
Bolt redeploys server functions by itself, but the published site does not update automatically. Click Publish > Update after your changes.
Updated