Get a result
Piece of cake 🍰. Obtaining a result is no different. It relies on a redirection made by your server, similar to launching a verification. Once your user finishes the verification process, our SDK will call the Result Endpoint
, which will redirect to your web app based on the result. For that to happen, you need to process this redirection in one of the following ways:
Option 1: Independent result pages
Our recommended approach is to create different URLs depending on the verification's success. Here are some examples:
- A phone-based sign-up flow:
- On success: The registration went through correctly, so the server redirects the user to
example.com/home?user={someValue}
. - On failure: The process is unsuccessful, and the server redirects to the previous screen with an error:
example.com/sign-up?error={errorCode}
.
- On success: The registration went through correctly, so the server redirects the user to
- An MFA/2FA flow confirms a transaction (e.g., wire transfer, purchase):
- On success: The transaction executes, and the server redirects the user to a confirmation screen at
example.com/tx/success?id={someId}
. - On failure: The server rejects the transaction and redirects to an error screen:
example.com/tx/error?id={someId}
.
- On success: The transaction executes, and the server redirects the user to a confirmation screen at
As you can see, your server should also insert some ID or value that ensures your web app can identify the operation made and that users cannot navigate to the destination without a valid result. Later, your web app can render any UI pertinent to that destination and continue the user journey.
Option 2: Single reusable page
Alternatively, your app can use the same page to handle the redirection, although this might only work for a limited set of use cases. For example:
- After validating the new number, a profile page lets users change their phone numbers. On each reload, the page gets profile data from the server.
- On success: The user validates their phone number correctly, so the server redirects to
example.com/profile
. - On failure: The user fails to validate their number, and the server redirects to:
example.com/profile?error={errorCode}
.
- On success: The user validates their phone number correctly, so the server redirects to
- An MFA/2FA flow confirms a transaction (e.g., wire transfer, purchase):
- On success: The transaction executes, and the server redirects the user to
example.com/tx?type=success&id={someId}
. - On failure: The server rejects the transaction and redirects to an error screen:
example.com/tx?type=error&id={someId}
.
- On success: The transaction executes, and the server redirects the user to
Next steps
Now that your implementation is complete, you can add phone verification to more flows within your app or integrate the SDK with other platforms.
Customization
If you haven't already, we recommend customizing your API key so that the UI matches your brand. Also, consider creating multiple API keys for your and your team's different environments.
Go to styling guide 🎨
Support
Questions? Comments? Something is missing? If you have questions, Contact us. We welcome your feedback and suggestions.