Intro
Authentication - Introduction
As an Embedded Wallet SDK, authentication is extremely important. Authentication works by establishing a session signing wallet through association with user credentials. For more on how our Embedded Wallet works, please see Embedded Wallet docs.
To implement authentication, we recommend using our SequenceLoginWindow boilerplate.
We recommend having the Canvas Scaler
component attached to your Canvas
use the “Scale with Screen Size” UI Scale Mode. This will make it so that the login window (and any other UI elements under this Canvas) are scaled automatically when switching between build targets.
This will provide you easy access to two authentication methods:
The SDK also provides support for:
Retrieving the SequenceWallet
Once you’ve obtained credentials from one of the supported authentication methods (please see their respective documentation), you’ll want to catch a reference to your newly created SequenceWallet
.
Please subscribe to the SequenceWallet.OnWalletCreated
event. This can be done with the following code snippet:
where OnWalletCreatedHandler
is a function accepting a SequenceWallet
as it’s only parameter. If you’re unfamiliar with working with events in Unity, check out this great Reddit post!
Error Handling
In order to catch errors during the login process, please make sure to subscribe to the OnLoginFailed
event.