InAppWallet.Create
Create an instance of InAppWallet
using a user's email, phone number or OAuth. This wallet type facilitates secure user authentication through OTP verification, making it suitable for client-facing applications where handling private keys directly is not ideal.
Usage
OTP Authentication Flow
The OTP authentication flow involves sending an OTP to the user's email or phone and then verifying the OTP to complete authentication:
Send OTP: Initiate the login process by calling SendOTP on the InAppWallet instance. This sends an OTP to the user's email or phone number.
Submit OTP: Once the user receives the OTP, they submit it back to the application, which then calls SubmitOTP on the InAppWallet instance to verify the OTP and complete the login process.
Example
Here's an example of creating an InAppWallet
with a user's email and completing the OTP authentication flow:
Note: InAppWallet leverages the security of OTP-based authentication to ensure a secure and user-friendly experience in blockchain applications.
OAuth Authentication Flow
LoginWithOauth: Initiate the login process by calling LoginWithOauth on the InAppWallet instance. This redirects the user to the OAuth provider's login page.
Example
Here's an example of creating an InAppWallet
using OAuth.
Note: The LoginWithOauth
API allows for custom browser handling, making it suitable for various application types and platforms.