feat: add Twilio SMS, voice, and verification emulator#63
Open
mvanhorn wants to merge 2 commits intovercel-labs:mainfrom
Open
feat: add Twilio SMS, voice, and verification emulator#63mvanhorn wants to merge 2 commits intovercel-labs:mainfrom
mvanhorn wants to merge 2 commits intovercel-labs:mainfrom
Conversation
Add @emulators/twilio package with endpoints for the Twilio Messages API (send, list, get), Calls API (create, list), and Verify API (send verification code, check code). Includes an inspector UI with tabs for messages, verifications, and calls. Verification codes are generated server-side and visible in the inspector UI, making it straightforward to test 2FA flows without sending real SMS. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
@mvanhorn is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
@emulators/twiliopackage with full Twilio REST API emulation for SMS, voice calls, and the Verify API (2FA verification codes). Includes an inspector UI with tabs for messages, verifications, and calls.Why this matters
Nearly every app with user authentication needs SMS verification or 2FA. Testing these flows currently requires hitting production Twilio (costs money per SMS, slow, unreliable in CI) or mocking at the HTTP level. No existing API emulator covers Twilio.
With this emulator, the full auth flow can run locally: OAuth sign-in (GitHub/Google emulator) -> phone verification (Twilio emulator) -> welcome email (Resend emulator). All without network access.
Changes
New package:
@emulators/twilioMessages API (
/2010-04-01/Accounts/:sid/Messages.json):Calls API (
/2010-04-01/Accounts/:sid/Calls.json):Verify API (
/v2/Services/:sid/VerificationsandVerificationCheck):Inspector UI (
/):renderInspectorPageSeed config:
Integration
twilioinSERVICE_REGISTRY(packages/emulate/src/registry.ts)@emulators/twilioas dev dependency ofemulateskills/twilio/SKILL.mdwith endpoint docs and examplesDemo
Shows sending an SMS, creating a verification code, and checking the code (approved). All local, no real SMS sent.
Testing
6 tests pass (4 existing + 2 new for Twilio):
twilio sends SMS and lists messages- Messages APItwilio verify sends code and checks it- Verify API with code extraction from inspector UIThis follows the same pattern as our previous service emulator PRs (#4 Stripe, #7 Resend, #10 Slack).
This contribution was developed with AI assistance (Claude Code).