Test sign-in and texting with real SMS.
A mocked code proves your form works. A real number proves the text arrives. Give each test its own line, read the code in one call, and run it on every push.
Pick your stack.
Working guides for the test runners and sign-in providers you already use.
- PlaywrightA complete Playwright SMS test: receive a fresh code with the Phonekit SDK, submit it in the browser, and assert the signed-in account.Read the guide
- Continuous integrationA complete GitHub Actions workflow for SDK-based SMS verification tests, with scoped secrets, number serialization, and trusted deployment configuration.Read the guide
- CypressA Cypress SMS recipe with server-side Phonekit tasks, an explicit fresh-message cursor, hidden code entry, and a final application assertion.Read the guide
- Supabase AuthTest Supabase SMS sign-in end to end with a selected Phonekit number, real receipt, verifyOtp, a session assertion, and explicit test-mode boundaries.Read the guide
- Firebase AuthA Firebase phone-auth acceptance recipe that preserves real app verification, receives an SMS through Phonekit, and distinguishes fictional-number coverage.Read the guide
- Twilio VerifyRun a complete Twilio Verify send, Phonekit SMS receipt and Verification Check test, with service isolation and unfinished-attempt cleanup.Read the guide
- iOS simulator / XCUITestA native Swift XCUITest recipe that receives real SMS through a test-runner HTTP fixture and enters the fresh code into the iOS simulator.Read the guide
Three lines in your test.
Mark the number, trigger the text, then wait for the code. Only a text that arrives after the mark counts, so a stale code never passes a test and parallel runs never read each other's codes.
Test anything your app texts.
Codes are where most teams start. Every wait returns the whole message, so the same test checks whatever your product sends.
Sign-in codes
Sign-up, sign-in, phone change and two-step checks, with the code pulled out for you.
Invites and magic links
Wait for the link, check where it goes, and open it in the browser your test controls.
Confirmations and alerts
Bookings, orders, reminders and alerts. Assert on the text your product actually sent.
Conversations
Text your product from your own numbers and check each reply, turn by turn.
Products that text, tested end to end.
If your product lives in the text channel, a code isn't enough. Give a test agent its own number, text your product and check the reply. Your numbers can text each other, so you can test a whole conversation.
- Table for 4 on Friday at 8?10:24:02
- I have 8:15 by the window. Want it?10:24:04
- Yes10:24:09
- Booked. Confirmation BK-2291.10:24:11
run 4 of 20 · reply in 2.1 s · assertion passed
Proven on every push.
Give CI a read-only key for its own numbers and one number per worker. A broken text path fails the build, not your users.
e2e · sign-in
on push · main · 52s
Set up job2s
Install Phonekit CLI3s
Mark the test lines1s
$phonekit message mark --number ci-signin-1
$phonekit message mark --number ci-signin-2
Marked. Now trigger the SMS, then run: phonekit code wait
Run sign-in tests41s
$npx playwright test e2e/sign-in.spec.ts
Running 24 tests using 2 workers, one line each
✓ [chromium] sign-in with SMS code (4.1s)
✓ [chromium] invite a teammate by text (5.3s)
✓ [webkit] sign-in with SMS code (4.4s)
✓ [webkit] reset password by text (4.9s)
…
24 passed (41.0s)
The details.
- Numbers
- US numbers. Standard is local VoIP; Mobile is a real SIM line, for flows that only text mobiles. VoIP or real SIM
- Messages
- The whole text of every message, with codes and links pulled out. Wait by sender, content or link. SDK
- Freshness
- Mark the number before the text is sent. Only a later text counts. One number per test
- Waiting
- The SDK checks every second until the deadline you set, up to an hour. SDK
- Languages
- JS/TS SDK for Node test runners, an HTTP API for any language, and a CLI for any shell. API
- CI
- A read-only key limited to its own numbers, with one number per worker. CI guide
- Sending
- Tests text inside a closed loop, with per-number limits. Limits
- Price
- From $29 a month for four numbers. Extra Standard numbers are $5 a month. Pricing
Questions
Can it read any text, not just codes?
Yes. Every wait returns the whole message: sender, body and time. Codes and links are pulled out for convenience, and you can wait for a message from a given sender, containing given text or linking to a given site.
Do I still need real SMS if I mock the code?
Keep the mocks for speed. Add one real journey for each way users sign in, so a broken text path fails a test instead of reaching users.
Which test frameworks and languages work?
The JS/TS SDK fits Playwright, Cypress and other Node test runners. The HTTP API works from any language, and the CLI works from any shell or CI step.
How long does a code take to arrive?
As long as the service that sends it takes. Phonekit hands the code over as soon as the text lands, and your test fails clearly at the deadline you set if nothing arrives.
Can tests run in parallel?
Yes. Give each worker its own number. Each test marks its number before the text is sent, so it never reads another run's code.
Does Phonekit replace my SMS provider?
No. Your app keeps sending through its own provider. Phonekit is the number that receives the text, and can text back within its limits.
Can I test a product that texts its users?
Yes. Give a test its own number, text your product and assert on the reply. Your numbers can text each other to test a whole conversation.
Keep reading
- Build the Playwright testA complete Playwright SMS test: receive a fresh code with the Phonekit SDK, submit it in the browser, and assert the signed-in account.
- Real or mocked SMS testsWhen to mock the code, when to use your auth provider's test numbers and when to send a real text, with a coverage matrix and a rollout plan.
- Phonekit vs building it yourselfThe code and costs of testing SMS codes on a number rented from an SMS API, side by side with Phonekit, and when building it yourself is the better choice.
Get a number.
Tell us what you're testing. We'll set up your workspace.
✓ sign-in with SMS code (4.2 s)