Phone Number Logins
Learn how to integrate phone number logins with Capsule SDK.
Overview
Capsule SDK provides support for phone number-based authentication, leveraging the Twilio API to enable a seamless login experience for your users. This feature allows you to implement a robust authentication system that links user wallets with unique phone number identifiers, preventing duplicate wallet creation across different login sessions.
To use phone number logins, ensure you’re using @usecapsule-web-sdk@1.13.0+
and
@usecapsule/react-sdk@3.7.0+
or later versions.
Integration Methods
Capsule SDK offers two primary methods for integrating phone number logins:
- Using the pre-built Capsule Modal
- Implementing a custom UI with manual control
Method 1: Capsule Modal
For a quick and easy integration, you can use the CapsuleModal
component. This pre-built solution
handles the entire login flow, including phone number input and verification.
The disablePhoneLogin
prop is false
by default, enabling phone authentication. Set it to
true
if you wish to exclude this feature from the modal.
Method 2: Custom UI Implementation
For developers who prefer more control over the authentication process or need to implement a custom UI, you can use the following guide to create your own phone number login and setup flows.
This implementation provides granular control over the login process:
- The
handleSubmitPhone
function manages phone number submission, checking if the user exists, and initiating the appropriate login or user creation flow. - The
handleVerifyPhone
function handles the verification of the phone number using the received code.
Need Assistance?
If you encounter any issues or need further clarification, don’t hesitate to reach out to our support team at support@usecapsule.com. We’re here to help you integrate Capsule SDK successfully into your application.
Was this page helpful?