A self-hosted mock is free and runs offline, which suits unit and integration tests. For E2E tests against staging you also need provider-accurate responses, Verify flows, an inbox your tests can query and a URL staging can reach. otpmock provides those for fifteen providers; building them yourself is very doable but becomes code you maintain.
Typical self-hosted options
- WireMock or a similar stub server. Record or hand-write responses for your provider's endpoints.
- LocalStack. Emulates AWS services including SNS locally, useful if you send through AWS.
- A small custom server. A few routes that accept the provider's request and store the text.
Side by side
| Self-hosted mock | otpmock | |
|---|---|---|
| Cost | Free software, your hosting | Free plan, paid plans from $19/month |
| Works offline | Yes | No |
| Provider response formats | You write them | Tested with each official SDK |
| Verify-style flows | You build them | Twilio, Vonage, Telnyx, Infobip, Sinch, Plivo, Telesign, Bird |
| Inbox and code extraction for tests | You build it | HTTP API and test helper |
| Reachable from staging and CI | You deploy it | Yes |
| Live view for manual QA | You build it | Dashboard |
When self-hosting makes sense
- Tests must run without network access.
- You use one provider and only its simple send endpoint.
- Policy forbids sending test data to any outside service.
When a hosted mock saves time
- Staging, CI and manual testers all need to see the same codes.
- Your app uses a Verify API where the provider generates the code.
- You support several providers or regions and don't want to maintain a mock for each.
FAQ
Can I mix both?
Yes. Many teams use a local stub in unit and integration tests and otpmock for E2E runs against staging.
What data does otpmock keep?
Messages expire after 10 minutes. See the privacy policy for details.
Product names are trademarks of their owners; otpmock is not affiliated with them. Descriptions of other products reflect their public documentation as of October 2026. Check their sites for current features and pricing.
The free plan includes 100 messages a month. No card required.
Get a free API key