When asking for help in this category, please make sure to provide the following details:
- SDK Version: 7.0.0
- Platform: Android & iOS
- Browser Console Screenshots:
- If the issue is related to Custom Authentication, please include the following information (optional):
- Verifier Name:
- JWKS Endpoint:
- Sample idToken (JWT):
Also, kindly provide the Web3Auth initialization and login code snippet below. This will help us better understand your issue and provide you with the necessary assistance.
Future<void> _initializeSingleFactorAuth() async {
try {
debugPrint('Starting Web3Auth Single Factor Auth initialization...');
// Get Web3Auth client ID from configuration
final clientId = AppConfig.web3AuthClientId;
debugPrint('SFA client ID: ${clientId.substring(0, 8)}...');
if (clientId.isEmpty) {
debugPrint('Web3Auth client ID is empty, aborting initialization');
isSFAInitialized.value = false;
return;
}
// Determine network based on environment
Web3AuthNetwork network;
switch (AppConfig.web3AuthNetworkConfig) {
case 'mainnet':
network = Web3AuthNetwork.sapphire_mainnet;
break;
case 'testnet':
default:
network = Web3AuthNetwork.sapphire_devnet;
break;
}
debugPrint('Using SFA network: $network');
// Prepare smart account configuration if enabled
_buildSmartAccountConfig();
// Initialize SFA with proper configuration including smart accounts
debugPrint(
'Calling SingleFactorAuth.init() with smart account config...',
);
await _singleFactorAuth.init(
Web3AuthOptions(
//accountAbstractionConfig: smartAccountConfig,
clientId: clientId,
network: network,
sessionTime: 86400, // 24 hours
// Note: accountAbstractionConfig may need to be added when the package supports it
// For now, we'll handle smart account logic in our service layer
),
);
debugPrint('SingleFactorAuth.init() completed successfully');
isSFAInitialized.value = true;
debugPrint('SFA initialization completed successfully');
// Check if user has an existing session
await _checkExistingSession();
} catch (e) {
debugPrint('SFA initialization failed: $e');
isSFAInitialized.value = false;
// Only throw if it's a real initialization error, not a session error
if (e.toString().contains('No user found') ||
e.toString().contains('No session found')) {
debugPrint(
'No existing session found - this is expected for new users',
);
isWalletReady.value = false;
} else {
throw Exception('Failed to initialize Single Factor Auth: $e');
}
}
}
We need to setup Smart Accounts in our wallet using flutter SFA, we are connecting successfully to web3auth but Web3AuthOptions in the SFA package doesn’t allow for “accountAbstractionConfig” and the documentation for Smart Accounts doesn’t cover Flutter. Are Smart Accounts supported in Flutter SFA?
Thank you in advance.