The Dynamic Unity SDK supports multiple authentication methods. After successful authentication, the SDK automatically populates the wallet list.
Email OTP
// Send OTP
await DynamicSDK.Instance.Auth.Email.SendOTP("user@example.com");
// Verify OTP (on a separate screen)
await DynamicSDK.Instance.Auth.Email.VerifyOTP("123456");
// Resend if needed
await DynamicSDK.Instance.Auth.Email.ResendOTP();
SMS OTP
await DynamicSDK.Instance.Auth.Sms.SendOTP(new PhoneData
{
DialCode = "+1",
Iso2 = "US",
Phone = "5551234567",
});
await DynamicSDK.Instance.Auth.Sms.VerifyOTP("123456");
Social login
await DynamicSDK.Instance.Auth.Social.Connect(SocialProvider.Google);
await DynamicSDK.Instance.Auth.Social.Connect(SocialProvider.Apple);
await DynamicSDK.Instance.Auth.Social.Connect(SocialProvider.Farcaster);
Passkey sign-in
Passkey sign-in only works on native devices (iOS/Android), not in the Unity Editor or macOS.
await DynamicSDK.Instance.Auth.Passkey.SignIn();
External JWT
For integrating with your own authentication system:
await DynamicSDK.Instance.Auth.ExternalAuth.SignInWithExternalJwt(
new SignInWithExternalJwtParams
{
ExternalJwt = jwtToken,
ExternalUserId = userId,
});
The easiest way to add authentication is using the built-in UI:
DynamicSDK.Instance.UI.ShowAuth();
This displays a full authentication flow with all enabled authentication methods.
Next steps